[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lwip-devel] Question about pcb->unsent_oversize in tcp_rexmit_rto
From: |
Axel Lin |
Subject: |
[lwip-devel] Question about pcb->unsent_oversize in tcp_rexmit_rto |
Date: |
Tue, 17 Jan 2017 14:16:25 +0800 |
Hi,
While reading the code, I don't understand below logic:
pcb->unsent_oversize will be updated only when TCP_OVERSIZE_DBGCHECK is set?
What if TCP_OVERSIZE && !TCP_OVERSIZE_DBGCHECK, then
if (pcb->unsent == NULL) pcb->unsent_oversize might be wrong?
1390 void
1391 tcp_rexmit_rto(struct tcp_pcb *pcb)
1392 {
1393 struct tcp_seg *seg;
1394
1395 if (pcb->unacked == NULL) {
1396 return;
1397 }
1398
1399 /* Move all unacked segments to the head of the unsent queue */
1400 for (seg = pcb->unacked; seg->next != NULL; seg = seg->next);
1401 /* concatenate unsent queue after unacked queue */
1402 seg->next = pcb->unsent;
1403 #if TCP_OVERSIZE_DBGCHECK
1404 /* if last unsent changed, we need to update unsent_oversize */
1405 if (pcb->unsent == NULL) {
1406 pcb->unsent_oversize = seg->oversize_left;
1407 }
1408 #endif /* TCP_OVERSIZE_DBGCHECK */
1409 /* unsent queue is the concatenated queue (of unacked, unsent) */
1410 pcb->unsent = pcb->unacked;
1411 /* unacked queue is now empty */
1412 pcb->unacked = NULL;
1413
- [lwip-devel] Question about pcb->unsent_oversize in tcp_rexmit_rto,
Axel Lin <=