Changes in uspace/srv/net/tcp/tqueue.c [78192cc7:c0f3460] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/net/tcp/tqueue.c
r78192cc7 rc0f3460 59 59 static void tcp_tqueue_timer_clear(tcp_conn_t *conn); 60 60 61 #include <stdio.h>62 61 int tcp_tqueue_init(tcp_tqueue_t *tqueue, tcp_conn_t *conn) 63 62 { 64 printf("tcp_tqueue_init\n");65 63 tqueue->conn = conn; 66 tqueue->timer = fibril_timer_create( &conn->lock);64 tqueue->timer = fibril_timer_create(); 67 65 if (tqueue->timer == NULL) 68 66 return ENOMEM; … … 80 78 void tcp_tqueue_fini(tcp_tqueue_t *tqueue) 81 79 { 82 printf("tcp_tqueue_fini\n");83 80 if (tqueue->timer != NULL) { 84 81 fibril_timer_destroy(tqueue->timer); … … 95 92 seg = tcp_segment_make_ctrl(ctrl); 96 93 tcp_tqueue_seg(conn, seg); 97 tcp_segment_delete(seg);98 94 } 99 95 … … 216 212 217 213 tcp_tqueue_seg(conn, seg); 218 tcp_segment_delete(seg);219 214 } 220 215 … … 322 317 log_msg(LOG_DEFAULT, LVL_DEBUG, "### %s: retransmit_timeout_func(%p)", conn->name, conn); 323 318 324 tcp_conn_lock(conn);319 fibril_mutex_lock(&conn->lock); 325 320 326 321 if (conn->cstate == st_closed) { 327 322 log_msg(LOG_DEFAULT, LVL_DEBUG, "Connection already closed."); 328 tcp_conn_unlock(conn);323 fibril_mutex_unlock(&conn->lock); 329 324 tcp_conn_delref(conn); 330 325 return; … … 334 329 if (link == NULL) { 335 330 log_msg(LOG_DEFAULT, LVL_DEBUG, "Nothing to retransmit"); 336 tcp_conn_unlock(conn);331 fibril_mutex_unlock(&conn->lock); 337 332 tcp_conn_delref(conn); 338 333 return; … … 344 339 if (rt_seg == NULL) { 345 340 log_msg(LOG_DEFAULT, LVL_ERROR, "Memory allocation failed."); 346 tcp_conn_unlock(conn);341 fibril_mutex_unlock(&conn->lock); 347 342 tcp_conn_delref(conn); 348 343 /* XXX Handle properly */ … … 356 351 tcp_tqueue_timer_set(tqe->conn); 357 352 358 tcp_conn_unlock(conn);353 fibril_mutex_unlock(&conn->lock); 359 354 tcp_conn_delref(conn); 360 361 log_msg(LOG_DEFAULT, LVL_DEBUG, "### %s: retransmit_timeout_func(%p) end", conn->name, conn);362 355 } 363 356 … … 365 358 static void tcp_tqueue_timer_set(tcp_conn_t *conn) 366 359 { 367 log_msg(LOG_DEFAULT, LVL_DEBUG, "### %s: tcp_tqueue_timer_set() begin", conn->name);360 log_msg(LOG_DEFAULT, LVL_DEBUG, "### %s: tcp_tqueue_timer_set()", conn->name); 368 361 369 362 /* Clear first to make sure we update refcnt correctly */ … … 371 364 372 365 tcp_conn_addref(conn); 373 fibril_timer_set _locked(conn->retransmit.timer, RETRANSMIT_TIMEOUT,366 fibril_timer_set(conn->retransmit.timer, RETRANSMIT_TIMEOUT, 374 367 retransmit_timeout_func, (void *) conn); 375 376 log_msg(LOG_DEFAULT, LVL_DEBUG, "### %s: tcp_tqueue_timer_set() end", conn->name);377 368 } 378 369 … … 380 371 static void tcp_tqueue_timer_clear(tcp_conn_t *conn) 381 372 { 382 log_msg(LOG_DEFAULT, LVL_DEBUG, "### %s: tcp_tqueue_timer_clear() begin", conn->name);383 384 if (fibril_timer_clear _locked(conn->retransmit.timer) == fts_active)373 log_msg(LOG_DEFAULT, LVL_DEBUG, "### %s: tcp_tqueue_timer_clear()", conn->name); 374 375 if (fibril_timer_clear(conn->retransmit.timer) == fts_active) 385 376 tcp_conn_delref(conn); 386 387 log_msg(LOG_DEFAULT, LVL_DEBUG, "### %s: tcp_tqueue_timer_clear() end", conn->name);388 377 } 389 378
Note:
See TracChangeset
for help on using the changeset viewer.