Henrik Nordstrom writes:
>When playing around with large requests the old "TCP Reset" issue comes
>to my mind again. We haven't done much to prevent them when closing
>client connections.
>
>Proposal on how to close client connection without TCP Reset:
>
>When we want to close the connection:
> * shutdown() our sending side
> * Set TCP Receive window to something small (setsockopt SO_RCVBUF)
> * Set remaining lifetime to ~30 seconds (max 2 minutes)
>Then:
> * Keep listenning for a client-side close (read() == 0), and close the
>socket immediately if seen.
> * Defer reading if read more than 1K, to avoid wasting bandwith, but
>don't close the connection (there may be a error message that we should
>let throught to the client).
>
>SO_LINGER does nothing to help this as the receiving side is shut down
>even whan SO_LINGER is enabled, and even if it keeps the receiver open
>until all data is acknowledged it does not guard us against evil TCP
>Resets (data is received by the receivers TCP, but not yet sent to the
>application, which tries to send something to us).
I added some optional code a while ago which makes a first attempt
at this. Look for LINGERING_CLOSE in comm.c and client_side.c
Duane W.
Received on Tue Jul 29 2003 - 13:15:51 MDT
This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:11:49 MST