Changes in uspace/srv/net/tcp/ucall.c [78192cc7:b243da3] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/net/tcp/ucall.c
r78192cc7 rb243da3 90 90 /* Wait for connection to be established or reset */ 91 91 log_msg(LOG_DEFAULT, LVL_DEBUG, "tcp_uc_open: Wait for connection."); 92 tcp_conn_lock(nconn);92 fibril_mutex_lock(&nconn->lock); 93 93 while (nconn->cstate == st_listen || 94 94 nconn->cstate == st_syn_sent || … … 100 100 log_msg(LOG_DEFAULT, LVL_DEBUG, "tcp_uc_open: Connection was reset."); 101 101 assert(nconn->cstate == st_closed); 102 tcp_conn_unlock(nconn);102 fibril_mutex_unlock(&nconn->lock); 103 103 return TCP_ERESET; 104 104 } 105 105 106 tcp_conn_unlock(nconn);106 fibril_mutex_unlock(&nconn->lock); 107 107 log_msg(LOG_DEFAULT, LVL_DEBUG, "tcp_uc_open: Connection was established."); 108 108 … … 121 121 log_msg(LOG_DEFAULT, LVL_DEBUG, "%s: tcp_uc_send()", conn->name); 122 122 123 tcp_conn_lock(conn);123 fibril_mutex_lock(&conn->lock); 124 124 125 125 if (conn->cstate == st_closed) { 126 tcp_conn_unlock(conn);126 fibril_mutex_unlock(&conn->lock); 127 127 return TCP_ENOTEXIST; 128 128 } … … 135 135 136 136 if (conn->snd_buf_fin) { 137 tcp_conn_unlock(conn);137 fibril_mutex_unlock(&conn->lock); 138 138 return TCP_ECLOSING; 139 139 } … … 149 149 150 150 if (conn->reset) { 151 tcp_conn_unlock(conn);151 fibril_mutex_unlock(&conn->lock); 152 152 return TCP_ERESET; 153 153 } … … 165 165 166 166 tcp_tqueue_new_data(conn); 167 tcp_conn_unlock(conn);167 fibril_mutex_unlock(&conn->lock); 168 168 169 169 return TCP_EOK; … … 178 178 log_msg(LOG_DEFAULT, LVL_DEBUG, "%s: tcp_uc_receive()", conn->name); 179 179 180 tcp_conn_lock(conn);180 fibril_mutex_lock(&conn->lock); 181 181 182 182 if (conn->cstate == st_closed) { 183 tcp_conn_unlock(conn);183 fibril_mutex_unlock(&conn->lock); 184 184 return TCP_ENOTEXIST; 185 185 } … … 197 197 if (conn->rcv_buf_fin) { 198 198 /* End of data, peer closed connection */ 199 tcp_conn_unlock(conn);199 fibril_mutex_unlock(&conn->lock); 200 200 return TCP_ECLOSING; 201 201 } else { 202 202 /* Connection was reset */ 203 203 assert(conn->reset); 204 tcp_conn_unlock(conn);204 fibril_mutex_unlock(&conn->lock); 205 205 return TCP_ERESET; 206 206 } … … 227 227 conn->name, xfer_size); 228 228 229 tcp_conn_unlock(conn);229 fibril_mutex_unlock(&conn->lock); 230 230 231 231 return TCP_EOK; … … 238 238 conn); 239 239 240 tcp_conn_lock(conn);240 fibril_mutex_lock(&conn->lock); 241 241 242 242 if (conn->cstate == st_closed) { 243 243 log_msg(LOG_DEFAULT, LVL_DEBUG, "tcp_uc_close - ENOTEXIST"); 244 tcp_conn_unlock(conn);244 fibril_mutex_unlock(&conn->lock); 245 245 return TCP_ENOTEXIST; 246 246 } … … 250 250 tcp_conn_reset(conn); 251 251 tcp_conn_remove(conn); 252 tcp_conn_unlock(conn);253 252 return TCP_EOK; 254 253 } … … 256 255 if (conn->snd_buf_fin) { 257 256 log_msg(LOG_DEFAULT, LVL_DEBUG, "tcp_uc_close - ECLOSING"); 258 tcp_conn_unlock(conn);257 fibril_mutex_unlock(&conn->lock); 259 258 return TCP_ECLOSING; 260 259 } … … 264 263 tcp_tqueue_new_data(conn); 265 264 266 tcp_conn_unlock(conn);265 fibril_mutex_unlock(&conn->lock); 267 266 return TCP_EOK; 268 267 } … … 322 321 } 323 322 324 tcp_conn_lock(conn);323 fibril_mutex_lock(&conn->lock); 325 324 326 325 if (conn->cstate == st_closed) { 327 326 log_msg(LOG_DEFAULT, LVL_WARN, "Connection is closed."); 328 327 tcp_unexpected_segment(sp, seg); 329 tcp_conn_unlock(conn);328 fibril_mutex_unlock(&conn->lock); 330 329 tcp_conn_delref(conn); 331 330 return; … … 343 342 tcp_conn_segment_arrived(conn, seg); 344 343 345 tcp_conn_unlock(conn);344 fibril_mutex_unlock(&conn->lock); 346 345 tcp_conn_delref(conn); 347 346 }
Note:
See TracChangeset
for help on using the changeset viewer.