lwip-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lwip-devel] [bug #24830] Socket never closed sometimes.


From: Kieran Mansley
Subject: [lwip-devel] [bug #24830] Socket never closed sometimes.
Date: Fri, 13 Feb 2009 10:16:25 +0000
User-agent: Opera/9.21 (X11; Linux i686; U; en)

Update of bug #24830 (project lwip):

         Planned Release:                         => 1.3.1                  

    _______________________________________________________

Follow-up Comment #4:

Sorry for the delay in responding to this. 

There is no IP address 82.18.19.2 in the trace, but I'm assuming you meant
192.66.66.3 (the HTTP client)

The client makes an HTTP request, but then sends a FIN before the server has
finished sending it.  This means the client has nothing more to send to the
server, but the server is still allowed to send to the client.  The server
continues to send the requested file, but the client does not provide any more
window.  This is not all that surprising: the application thinks it has closed
this socket, and so won't be reading from it, and so the window does not get
replenished.

It is right that the stack has gone into FIN_WAIT_2, and is waiting for the
other side to send FIN before continuing to TIME_WAIT and CLOSED.

The traffic you see at the end is the server using the TCP keep alive
protocol to probe the connection to see if the other end is still there.  This
is also fine.

What is wrong is that lwIP should have sent a RST to close the connection
rather than a FIN if there were any data queued for the client when it called
close, and/or it should have sent a RST when it received data after the
connection had been closed.  This tells the other end that no further data
will reach the client application.

The fix for this should be relatively straightforward.  It would be good to
retain the current behaviour as that is what is needed for shutdown() rather
than close(), and although we provide shutdown() in the API it's not
separately implemented.

Thanks for spotting this.

    _______________________________________________________

Reply to this item at:

  <http://savannah.nongnu.org/bugs/?24830>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.nongnu.org/





reply via email to

[Prev in Thread] Current Thread [Next in Thread]