Changeset d9e14fa4 in mainline for uspace/srv/net/tl/tcp/ucall.c
- Timestamp:
- 2011-12-09T16:06:28Z (12 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 03be171
- Parents:
- 0ac2158
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/net/tl/tcp/ucall.c
r0ac2158 rd9e14fa4 126 126 while (size > 0) { 127 127 buf_free = conn->snd_buf_size - conn->snd_buf_used; 128 while (buf_free == 0 )128 while (buf_free == 0 && !conn->reset) 129 129 tcp_tqueue_new_data(conn); 130 131 if (conn->reset) 132 return TCP_ERESET; 130 133 131 134 xfer_size = min(size, buf_free); … … 157 160 158 161 /* Wait for data to become available */ 159 while (conn->rcv_buf_used == 0 && !conn->rcv_buf_fin ) {162 while (conn->rcv_buf_used == 0 && !conn->rcv_buf_fin && !conn->reset) { 160 163 log_msg(LVL_DEBUG, "tcp_uc_receive() - wait for data"); 161 164 fibril_condvar_wait(&conn->rcv_buf_cv, &conn->rcv_buf_lock); … … 165 168 fibril_mutex_unlock(&conn->rcv_buf_lock); 166 169 167 /* End of data, peer closed connection. */168 assert(conn->rcv_buf_fin);169 170 *rcvd = 0; 170 171 *xflags = 0; 171 return TCP_ECLOSING; 172 173 if (conn->rcv_buf_fin) { 174 /* End of data, peer closed connection */ 175 return TCP_ECLOSING; 176 } else { 177 /* Connection was reset */ 178 assert(conn->reset); 179 return TCP_ERESET; 180 } 172 181 } 173 182
Note:
See TracChangeset
for help on using the changeset viewer.