[ros-diffs] [cgutman] 53106: [LWIP] - Set the TF_FIN flag if we add the FIN to an outgoing packet (previously only set when sending an empty FIN) - This is definitely a lwIP bug that needs to be fixed so I wil...

cgutman at svn.reactos.org cgutman at svn.reactos.org
Sat Aug 6 23:07:55 UTC 2011


Author: cgutman
Date: Sat Aug  6 23:07:54 2011
New Revision: 53106

URL: http://svn.reactos.org/svn/reactos?rev=53106&view=rev
Log:
[LWIP]
- Set the TF_FIN flag if we add the FIN to an outgoing packet (previously only set when sending an empty FIN)
- This is definitely a lwIP bug that needs to be fixed so I will open a bug for this
- Fixes the last remaining known lwIP bug (ws2_32:sock tests don't lose data anymore)

Modified:
    branches/GSoC_2011/TcpIpDriver/lib/drivers/lwip/src/core/tcp_out.c

Modified: branches/GSoC_2011/TcpIpDriver/lib/drivers/lwip/src/core/tcp_out.c
URL: http://svn.reactos.org/svn/reactos/branches/GSoC_2011/TcpIpDriver/lib/drivers/lwip/src/core/tcp_out.c?rev=53106&r1=53105&r2=53106&view=diff
==============================================================================
--- branches/GSoC_2011/TcpIpDriver/lib/drivers/lwip/src/core/tcp_out.c [iso-8859-1] (original)
+++ branches/GSoC_2011/TcpIpDriver/lib/drivers/lwip/src/core/tcp_out.c [iso-8859-1] Sat Aug  6 23:07:54 2011
@@ -131,6 +131,7 @@
     if ((TCPH_FLAGS(last_unsent->tcphdr) & (TCP_SYN | TCP_FIN | TCP_RST)) == 0) {
       /* no SYN/FIN/RST flag in the header, we can add the FIN flag */
       TCPH_SET_FLAG(last_unsent->tcphdr, TCP_FIN);
+      pcb->flags |= TF_FIN;
       return ERR_OK;
     }
   }
@@ -949,6 +950,7 @@
   }
 #endif /* TCP_CWND_DEBUG */
   /* data available and window allows it to be sent? */
+  if (seg) DbgPrint("%d <= %d\n", (ntohl(seg->tcphdr->seqno) - pcb->lastack + seg->len), wnd);
   while (seg != NULL &&
          ntohl(seg->tcphdr->seqno) - pcb->lastack + seg->len <= wnd) {
     LWIP_ASSERT("RST not expected here!", 
@@ -962,6 +964,7 @@
      */
     if((tcp_do_output_nagle(pcb) == 0) &&
       ((pcb->flags & (TF_NAGLEMEMERR | TF_FIN)) == 0)){
+      DbgPrint("-----------------> NOT SENDING DUE TO NAGLE %d\n", tcp_do_output_nagle(pcb));
       break;
     }
 #if TCP_CWND_DEBUG




More information about the Ros-diffs mailing list