Changeset 0edaf0f6 in mainline for uspace/srv/net/tl/tcp/tqueue.c
- Timestamp:
- 2011-12-16T18:04:30Z (12 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- ab9378b4
- Parents:
- 7a8c1c4e
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/net/tl/tcp/tqueue.c
r7a8c1c4e r0edaf0f6 167 167 log_msg(LVL_DEBUG, "%s: tcp_tqueue_new_data()", conn->name); 168 168 169 fibril_mutex_lock(&conn->snd_buf_lock);170 171 169 /* Number of free sequence numbers in send window */ 172 170 avail_wnd = (conn->snd_una + conn->snd_wnd) - conn->snd_nxt; … … 178 176 xfer_seqlen); 179 177 180 if (xfer_seqlen == 0) { 181 fibril_mutex_unlock(&conn->snd_buf_lock); 182 return; 183 } 178 if (xfer_seqlen == 0) 179 return; 184 180 185 181 /* XXX Do not always send immediately */ … … 198 194 seg = tcp_segment_make_data(ctrl, conn->snd_buf, data_size); 199 195 if (seg == NULL) { 200 fibril_mutex_unlock(&conn->snd_buf_lock);201 196 log_msg(LVL_ERROR, "Memory allocation failure."); 202 197 return; … … 212 207 213 208 fibril_condvar_broadcast(&conn->snd_buf_cv); 214 fibril_mutex_unlock(&conn->snd_buf_lock);215 209 216 210 if (send_fin) … … 323 317 log_msg(LVL_DEBUG, "### %s: retransmit_timeout_func(%p)", conn->name, conn); 324 318 319 fibril_mutex_lock(&conn->lock); 320 325 321 if (conn->cstate == st_closed) { 326 322 log_msg(LVL_DEBUG, "Connection already closed."); 323 fibril_mutex_unlock(&conn->lock); 324 tcp_conn_delref(conn); 327 325 return; 328 326 } … … 331 329 if (link == NULL) { 332 330 log_msg(LVL_DEBUG, "Nothing to retransmit"); 331 fibril_mutex_unlock(&conn->lock); 332 tcp_conn_delref(conn); 333 333 return; 334 334 } … … 339 339 if (rt_seg == NULL) { 340 340 log_msg(LVL_ERROR, "Memory allocation failed."); 341 fibril_mutex_unlock(&conn->lock); 342 tcp_conn_delref(conn); 341 343 /* XXX Handle properly */ 342 344 return; … … 348 350 /* Reset retransmission timer */ 349 351 tcp_tqueue_timer_set(tqe->conn); 352 353 fibril_mutex_unlock(&conn->lock); 354 tcp_conn_delref(conn); 350 355 } 351 356 … … 355 360 log_msg(LVL_DEBUG, "### %s: tcp_tqueue_timer_set()", conn->name); 356 361 357 (void) retransmit_timeout_func; 362 /* Clear first to make sure we update refcnt correctly */ 363 tcp_tqueue_timer_clear(conn); 364 365 tcp_conn_addref(conn); 358 366 fibril_timer_set(conn->retransmit.timer, RETRANSMIT_TIMEOUT, 359 367 retransmit_timeout_func, (void *) conn); … … 365 373 log_msg(LVL_DEBUG, "### %s: tcp_tqueue_timer_clear()", conn->name); 366 374 367 fibril_timer_clear(conn->retransmit.timer); 375 if (fibril_timer_clear(conn->retransmit.timer) == fts_active) 376 tcp_conn_delref(conn); 368 377 } 369 378
Note:
See TracChangeset
for help on using the changeset viewer.