Changes in uspace/srv/net/tcp/tqueue.c [a2e3ee6:f0a2720] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/net/tcp/tqueue.c
ra2e3ee6 rf0a2720 88 88 tcp_segment_t *seg; 89 89 90 log_msg(L OG_DEFAULT, LVL_DEBUG, "tcp_tqueue_ctrl_seg(%p, %u)", conn, ctrl);90 log_msg(LVL_DEBUG, "tcp_tqueue_ctrl_seg(%p, %u)", conn, ctrl); 91 91 92 92 seg = tcp_segment_make_ctrl(ctrl); … … 99 99 tcp_tqueue_entry_t *tqe; 100 100 101 log_msg(L OG_DEFAULT, LVL_DEBUG, "%s: tcp_tqueue_seg(%p, %p)", conn->name, conn,101 log_msg(LVL_DEBUG, "%s: tcp_tqueue_seg(%p, %p)", conn->name, conn, 102 102 seg); 103 103 … … 109 109 rt_seg = tcp_segment_dup(seg); 110 110 if (rt_seg == NULL) { 111 log_msg(L OG_DEFAULT, LVL_ERROR, "Memory allocation failed.");111 log_msg(LVL_ERROR, "Memory allocation failed."); 112 112 /* XXX Handle properly */ 113 113 return; … … 116 116 tqe = calloc(1, sizeof(tcp_tqueue_entry_t)); 117 117 if (tqe == NULL) { 118 log_msg(L OG_DEFAULT, LVL_ERROR, "Memory allocation failed.");118 log_msg(LVL_ERROR, "Memory allocation failed."); 119 119 /* XXX Handle properly */ 120 120 return; … … 165 165 tcp_segment_t *seg; 166 166 167 log_msg(L OG_DEFAULT, LVL_DEBUG, "%s: tcp_tqueue_new_data()", conn->name);167 log_msg(LVL_DEBUG, "%s: tcp_tqueue_new_data()", conn->name); 168 168 169 169 /* Number of free sequence numbers in send window */ … … 172 172 173 173 xfer_seqlen = min(snd_buf_seqlen, avail_wnd); 174 log_msg(L OG_DEFAULT, LVL_DEBUG, "%s: snd_buf_seqlen = %zu, SND.WND = %" PRIu32 ", "174 log_msg(LVL_DEBUG, "%s: snd_buf_seqlen = %zu, SND.WND = %" PRIu32 ", " 175 175 "xfer_seqlen = %zu", conn->name, snd_buf_seqlen, conn->snd_wnd, 176 176 xfer_seqlen); … … 185 185 186 186 if (send_fin) { 187 log_msg(L OG_DEFAULT, LVL_DEBUG, "%s: Sending out FIN.", conn->name);187 log_msg(LVL_DEBUG, "%s: Sending out FIN.", conn->name); 188 188 /* We are sending out FIN */ 189 189 ctrl = CTL_FIN; … … 194 194 seg = tcp_segment_make_data(ctrl, conn->snd_buf, data_size); 195 195 if (seg == NULL) { 196 log_msg(L OG_DEFAULT, LVL_ERROR, "Memory allocation failure.");196 log_msg(LVL_ERROR, "Memory allocation failure."); 197 197 return; 198 198 } … … 223 223 link_t *cur, *next; 224 224 225 log_msg(L OG_DEFAULT, LVL_DEBUG, "%s: tcp_tqueue_ack_received(%p)", conn->name,225 log_msg(LVL_DEBUG, "%s: tcp_tqueue_ack_received(%p)", conn->name, 226 226 conn); 227 227 … … 239 239 240 240 if ((tqe->seg->ctrl & CTL_FIN) != 0) { 241 log_msg(L OG_DEFAULT, LVL_DEBUG, "Fin has been acked");242 log_msg(L OG_DEFAULT, LVL_DEBUG, "SND.UNA=%" PRIu32241 log_msg(LVL_DEBUG, "Fin has been acked"); 242 log_msg(LVL_DEBUG, "SND.UNA=%" PRIu32 243 243 " SEG.SEQ=%" PRIu32 " SEG.LEN=%" PRIu32, 244 244 conn->snd_una, tqe->seg->seq, tqe->seg->len); … … 267 267 void tcp_conn_transmit_segment(tcp_conn_t *conn, tcp_segment_t *seg) 268 268 { 269 log_msg(L OG_DEFAULT, LVL_DEBUG, "%s: tcp_conn_transmit_segment(%p, %p)",269 log_msg(LVL_DEBUG, "%s: tcp_conn_transmit_segment(%p, %p)", 270 270 conn->name, conn, seg); 271 271 … … 282 282 void tcp_transmit_segment(tcp_sockpair_t *sp, tcp_segment_t *seg) 283 283 { 284 log_msg(LOG_DEFAULT, LVL_DEBUG, "SEG.SEQ=%" PRIu32 ", SEG.WND=%" PRIu32, 284 log_msg(LVL_DEBUG, "tcp_transmit_segment(f:(%x,%u),l:(%x,%u), %p)", 285 sp->foreign.addr.ipv4, sp->foreign.port, 286 sp->local.addr.ipv4, sp->local.port, seg); 287 288 log_msg(LVL_DEBUG, "SEG.SEQ=%" PRIu32 ", SEG.WND=%" PRIu32, 285 289 seg->seq, seg->wnd); 286 290 … … 296 300 297 301 if (tcp_pdu_encode(sp, seg, &pdu) != EOK) { 298 log_msg(L OG_DEFAULT, LVL_WARN, "Not enough memory. Segment dropped.");302 log_msg(LVL_WARN, "Not enough memory. Segment dropped."); 299 303 return; 300 304 } … … 311 315 link_t *link; 312 316 313 log_msg(L OG_DEFAULT, LVL_DEBUG, "### %s: retransmit_timeout_func(%p)", conn->name, conn);317 log_msg(LVL_DEBUG, "### %s: retransmit_timeout_func(%p)", conn->name, conn); 314 318 315 319 fibril_mutex_lock(&conn->lock); 316 320 317 321 if (conn->cstate == st_closed) { 318 log_msg(L OG_DEFAULT, LVL_DEBUG, "Connection already closed.");322 log_msg(LVL_DEBUG, "Connection already closed."); 319 323 fibril_mutex_unlock(&conn->lock); 320 324 tcp_conn_delref(conn); … … 324 328 link = list_first(&conn->retransmit.list); 325 329 if (link == NULL) { 326 log_msg(L OG_DEFAULT, LVL_DEBUG, "Nothing to retransmit");330 log_msg(LVL_DEBUG, "Nothing to retransmit"); 327 331 fibril_mutex_unlock(&conn->lock); 328 332 tcp_conn_delref(conn); … … 334 338 rt_seg = tcp_segment_dup(tqe->seg); 335 339 if (rt_seg == NULL) { 336 log_msg(L OG_DEFAULT, LVL_ERROR, "Memory allocation failed.");340 log_msg(LVL_ERROR, "Memory allocation failed."); 337 341 fibril_mutex_unlock(&conn->lock); 338 342 tcp_conn_delref(conn); … … 341 345 } 342 346 343 log_msg(L OG_DEFAULT, LVL_DEBUG, "### %s: retransmitting segment", conn->name);347 log_msg(LVL_DEBUG, "### %s: retransmitting segment", conn->name); 344 348 tcp_conn_transmit_segment(tqe->conn, rt_seg); 345 349 … … 354 358 static void tcp_tqueue_timer_set(tcp_conn_t *conn) 355 359 { 356 log_msg(L OG_DEFAULT, LVL_DEBUG, "### %s: tcp_tqueue_timer_set()", conn->name);360 log_msg(LVL_DEBUG, "### %s: tcp_tqueue_timer_set()", conn->name); 357 361 358 362 /* Clear first to make sure we update refcnt correctly */ … … 367 371 static void tcp_tqueue_timer_clear(tcp_conn_t *conn) 368 372 { 369 log_msg(L OG_DEFAULT, LVL_DEBUG, "### %s: tcp_tqueue_timer_clear()", conn->name);373 log_msg(LVL_DEBUG, "### %s: tcp_tqueue_timer_clear()", conn->name); 370 374 371 375 if (fibril_timer_clear(conn->retransmit.timer) == fts_active)
Note:
See TracChangeset
for help on using the changeset viewer.