Fri 13 Feb 2009 10:16:23 AM UTC, 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.
|