From: Eric Dumazet <eric.dumazet@gmail.com>
To: Willy Tarreau <w@1wt.eu>
Cc: Julian Anastasov <ja@ssi.bg>, netdev@vger.kernel.org
Subject: Re: TCP: orphans broken by RFC 2525 #2.17
Date: Mon, 27 Sep 2010 22:00:53 +0200 [thread overview]
Message-ID: <1285617653.2512.67.camel@edumazet-laptop> (raw)
In-Reply-To: <20100927192450.GU12373@1wt.eu>
Le lundi 27 septembre 2010 à 21:24 +0200, Willy Tarreau a écrit :
> Hi Julian
>
> [removed Davem from the CC upon his request, not to pollute him]
>
> On Mon, Sep 27, 2010 at 12:12:24PM +0300, Julian Anastasov wrote:
> > If it is not already mentioned, the application can
> > know if sent data is acked. I think, ioctl SIOCOUTQ is for
> > this purpose. May be the application that wants to send
> > reliably HTTP error response before closing should do something
> > like:
> >
> > - add this FD in some list for monitoring instead of keeping
> > large connection state
> > - use shutdown SHUT_WR to add FIN after response
> > - use setsockopt SO_RCVBUF with some low value to close the
> > RX window, we do not want the body
> > - wait for POLLHUP (FIN), not for POLLIN because we want to
> > ignore data, not to read it. Still, data can be read and
> > dropped if needed to release the socket memory
> > - use timer to limit the time we wait our data to be acked
> > - use SIOCOUTQ to know if everything is received in peer and
> > then close the fd
>
> Thanks very much for this suggestion. I was looking for something
> like this and even looked at the tcp_info struct, but it did not
> look very easy to use.
>
> Still, I think that polling on POLLIN and checking with SIOCOUTQ
> on every read to see if the out queue is now empty would do the
> trick, without forcing to read huge amounts of unnecessary data.
>
> I'll simply enclose that inside a #ifdef LINUX and that should be
> OK. It kinda sucks to be able to workaround low level issues at the
> application level but at least this workaround is acceptable.
Just a point :
RFC1122 :
A host MAY implement a "half-duplex" TCP close sequence, so
that an application that has called CLOSE cannot continue to
read data from the connection. If such a host issues a
CLOSE call while received data is still pending in TCP, or
if new data is received after CLOSE is called, its TCP
SHOULD send a RST to show that data was lost.
Maybe only linux respects the RFC ? ;)
next prev parent reply other threads:[~2010-09-27 20:01 UTC|newest]
Thread overview: 39+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-09-26 13:17 TCP: orphans broken by RFC 2525 #2.17 Willy Tarreau
2010-09-26 17:02 ` Eric Dumazet
2010-09-26 17:40 ` Willy Tarreau
2010-09-26 18:35 ` Eric Dumazet
2010-09-26 18:49 ` Willy Tarreau
2010-09-26 21:01 ` Eric Dumazet
2010-09-26 21:46 ` Willy Tarreau
2010-09-26 22:19 ` David Miller
2010-09-26 22:10 ` David Miller
2010-09-26 19:16 ` Willy Tarreau
2010-09-26 22:14 ` David Miller
2010-09-26 22:13 ` David Miller
2010-09-26 22:34 ` Willy Tarreau
2010-09-26 22:38 ` David Miller
2010-09-26 22:54 ` Willy Tarreau
2010-09-26 23:08 ` David Miller
2010-09-26 23:25 ` Willy Tarreau
2010-09-27 1:12 ` David Miller
2010-09-27 5:39 ` Willy Tarreau
2010-09-27 5:48 ` Eric Dumazet
2010-09-27 6:04 ` Willy Tarreau
2010-09-27 6:44 ` David Miller
2010-09-27 6:42 ` David Miller
2010-09-27 7:34 ` Willy Tarreau
2010-09-27 7:42 ` David Miller
2010-09-27 19:21 ` Willy Tarreau
2010-09-27 23:28 ` Herbert Xu
2010-09-28 5:12 ` Willy Tarreau
2010-09-28 5:32 ` David Miller
2010-09-28 5:37 ` Willy Tarreau
2010-09-27 9:12 ` Julian Anastasov
2010-09-27 19:24 ` Willy Tarreau
2010-09-27 20:00 ` Eric Dumazet [this message]
2010-09-28 9:01 ` Julian Anastasov
2010-09-28 9:26 ` Willy Tarreau
2010-09-27 8:02 ` Herbert Xu
2010-09-27 20:00 ` Willy Tarreau
2010-09-27 20:08 ` Rick Jones
2010-09-27 20:20 ` Willy Tarreau
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1285617653.2512.67.camel@edumazet-laptop \
--to=eric.dumazet@gmail.com \
--cc=ja@ssi.bg \
--cc=netdev@vger.kernel.org \
--cc=w@1wt.eu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox