Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 8 Mar 2001 13:10:28 -0800
From:      "Jonathan Graehl" <jonathan@graehl.org>
To:        "Freebsd-Net" <freebsd-net@freebsd.org>
Subject:   RE: [itojun@iijlab.net: accept(2) behavior with tcp RST right after handshake]
Message-ID:  <NCBBLOALCKKINBNNEDDLIECMDMAA.jonathan@graehl.org>
In-Reply-To: <NCBBLOALCKKINBNNEDDLKECLDMAA.jonathan@graehl.org>

next in thread | previous in thread | raw e-mail | index | archive | help
I would like to preempt corrections to the effect that it is currently
impossible for accept to return both an error code and a socket to read the data
from.  It sounds like there may be a bug in the behavior of accept w.r.t Unix
Domain sockets.  For TCP, if the client sends data, then closes with SO_LINGER
sending a RST, and then the server accepts, it is appropriate to return an error
code and even lose the sent data.  However, if the client simply sends a FIN
(indicating that it will send no more data), then the connection should
definitely accept without error, since the connection is only half-closed, and
the server can send data to the client (in this case of accepting a half-closed
connection, for kevent, a read filter should mark EV_EOF, and a write filter
should not)

> Let's agree: it is okay for accept to return an error code indicating the
> connection has already been terminated, so long as any data sent by the client
> (such that the client had every indication that it was received) is still
> available for the acceptor to read.
>
> -Jon


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-net" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?NCBBLOALCKKINBNNEDDLIECMDMAA.jonathan>