Changeset d9ce049 in mainline for uspace/srv/net/tl/tcp/conn.c
- Timestamp:
- 2011-10-04T20:40:05Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 8c7a054
- Parents:
- 32105348
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/net/tl/tcp/conn.c
r32105348 rd9ce049 70 70 71 71 /* Allocate receive buffer */ 72 fibril_mutex_initialize(&conn->rcv_buf_lock); 73 fibril_condvar_initialize(&conn->rcv_buf_cv); 72 74 conn->rcv_buf_size = RCV_BUF_SIZE; 73 75 conn->rcv_buf_used = 0; 76 74 77 conn->rcv_buf = calloc(1, conn->rcv_buf_size); 75 78 if (conn->rcv_buf == NULL) { … … 306 309 if ((seg->ctrl & CTL_ACK) != 0) { 307 310 conn->snd_una = seg->ack; 308 tcp_tqueue_remove_acked(conn); 311 312 /* 313 * Prune acked segments from retransmission queue and 314 * possibly transmit more data. 315 */ 316 tcp_tqueue_ack_received(conn); 309 317 } 310 318 … … 459 467 /* Update SND.UNA */ 460 468 conn->snd_una = seg->ack; 461 462 /* Prune acked segments from retransmission queue */463 tcp_tqueue_remove_acked(conn);464 469 } 465 470 … … 468 473 conn->snd_wl1 = seg->seq; 469 474 conn->snd_wl2 = seg->ack; 470 } 475 476 log_msg(LVL_DEBUG, "Updating send window, SND.WND=%" PRIu32 477 ", SND.WL1=%" PRIu32 ", SND.WL2=%" PRIu32, 478 conn->snd_wnd, conn->snd_wl1, conn->snd_wl2); 479 } 480 481 /* 482 * Prune acked segments from retransmission queue and 483 * possibly transmit more data. 484 */ 485 tcp_tqueue_ack_received(conn); 471 486 472 487 return cp_continue; … … 659 674 tcp_conn_trim_seg_to_wnd(conn, seg); 660 675 676 fibril_mutex_lock(&conn->rcv_buf_lock); 677 661 678 /* Determine how many bytes to copy */ 662 679 text_size = tcp_segment_text_size(seg); … … 664 681 665 682 /* Copy data to receive buffer */ 666 tcp_segment_text_copy(seg, conn->rcv_buf, xfer_size); 683 tcp_segment_text_copy(seg, conn->rcv_buf + conn->rcv_buf_used, 684 xfer_size); 685 conn->rcv_buf_used += xfer_size; 686 687 /* Signal to the receive function that new data has arrived */ 688 fibril_condvar_broadcast(&conn->rcv_buf_cv); 689 fibril_mutex_unlock(&conn->rcv_buf_lock); 667 690 668 691 log_msg(LVL_DEBUG, "Received %zu bytes of data.", xfer_size);
Note:
See TracChangeset
for help on using the changeset viewer.