Changes in uspace/srv/net/tcp/tqueue.c [7c15d6f:c0f3460] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/net/tcp/tqueue.c
r7c15d6f rc0f3460 1 1 /* 2 * Copyright (c) 201 5Jiri Svoboda2 * Copyright (c) 2011 Jiri Svoboda 3 3 * All rights reserved. 4 4 * … … 62 62 { 63 63 tqueue->conn = conn; 64 tqueue->timer = fibril_timer_create( &conn->lock);64 tqueue->timer = fibril_timer_create(); 65 65 if (tqueue->timer == NULL) 66 66 return ENOMEM; … … 92 92 seg = tcp_segment_make_ctrl(ctrl); 93 93 tcp_tqueue_seg(conn, seg); 94 tcp_segment_delete(seg);95 94 } 96 95 … … 213 212 214 213 tcp_tqueue_seg(conn, seg); 215 tcp_segment_delete(seg);216 214 } 217 215 … … 282 280 } 283 281 284 void tcp_transmit_segment( inet_ep2_t *epp, tcp_segment_t *seg)282 void tcp_transmit_segment(tcp_sockpair_t *sp, tcp_segment_t *seg) 285 283 { 286 284 log_msg(LOG_DEFAULT, LVL_DEBUG, 287 "tcp_transmit_segment( l:(%u),f:(%u), %p)",288 epp->local.port, epp->remote.port, seg);289 285 "tcp_transmit_segment(f:(%u),l:(%u), %p)", 286 sp->local.port, sp->foreign.port, seg); 287 290 288 log_msg(LOG_DEFAULT, LVL_DEBUG, "SEG.SEQ=%" PRIu32 ", SEG.WND=%" PRIu32, 291 289 seg->seq, seg->wnd); … … 301 299 tcp_pdu_t *pdu; 302 300 303 if (tcp_pdu_encode( epp, seg, &pdu) != EOK) {301 if (tcp_pdu_encode(sp, seg, &pdu) != EOK) { 304 302 log_msg(LOG_DEFAULT, LVL_WARN, "Not enough memory. Segment dropped."); 305 303 return; … … 319 317 log_msg(LOG_DEFAULT, LVL_DEBUG, "### %s: retransmit_timeout_func(%p)", conn->name, conn); 320 318 321 tcp_conn_lock(conn);319 fibril_mutex_lock(&conn->lock); 322 320 323 321 if (conn->cstate == st_closed) { 324 322 log_msg(LOG_DEFAULT, LVL_DEBUG, "Connection already closed."); 325 tcp_conn_unlock(conn);323 fibril_mutex_unlock(&conn->lock); 326 324 tcp_conn_delref(conn); 327 325 return; … … 331 329 if (link == NULL) { 332 330 log_msg(LOG_DEFAULT, LVL_DEBUG, "Nothing to retransmit"); 333 tcp_conn_unlock(conn);331 fibril_mutex_unlock(&conn->lock); 334 332 tcp_conn_delref(conn); 335 333 return; … … 341 339 if (rt_seg == NULL) { 342 340 log_msg(LOG_DEFAULT, LVL_ERROR, "Memory allocation failed."); 343 tcp_conn_unlock(conn);341 fibril_mutex_unlock(&conn->lock); 344 342 tcp_conn_delref(conn); 345 343 /* XXX Handle properly */ … … 351 349 352 350 /* Reset retransmission timer */ 353 fibril_timer_set_locked(conn->retransmit.timer, RETRANSMIT_TIMEOUT, 354 retransmit_timeout_func, (void *) conn); 355 356 tcp_conn_unlock(conn); 357 358 log_msg(LOG_DEFAULT, LVL_DEBUG, "### %s: retransmit_timeout_func(%p) end", conn->name, conn); 351 tcp_tqueue_timer_set(tqe->conn); 352 353 fibril_mutex_unlock(&conn->lock); 354 tcp_conn_delref(conn); 359 355 } 360 356 … … 362 358 static void tcp_tqueue_timer_set(tcp_conn_t *conn) 363 359 { 364 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); 365 361 366 362 /* Clear first to make sure we update refcnt correctly */ … … 368 364 369 365 tcp_conn_addref(conn); 370 fibril_timer_set _locked(conn->retransmit.timer, RETRANSMIT_TIMEOUT,366 fibril_timer_set(conn->retransmit.timer, RETRANSMIT_TIMEOUT, 371 367 retransmit_timeout_func, (void *) conn); 372 373 log_msg(LOG_DEFAULT, LVL_DEBUG, "### %s: tcp_tqueue_timer_set() end", conn->name);374 368 } 375 369 … … 377 371 static void tcp_tqueue_timer_clear(tcp_conn_t *conn) 378 372 { 379 log_msg(LOG_DEFAULT, LVL_DEBUG, "### %s: tcp_tqueue_timer_clear() begin", conn->name);380 381 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) 382 376 tcp_conn_delref(conn); 383 384 log_msg(LOG_DEFAULT, LVL_DEBUG, "### %s: tcp_tqueue_timer_clear() end", conn->name);385 377 } 386 378
Note:
See TracChangeset
for help on using the changeset viewer.