From owner-freebsd-net Thu Mar 8 13:10:45 2001 Delivered-To: freebsd-net@freebsd.org Received: from molly.straylight.com (molly.straylight.com [209.68.199.242]) by hub.freebsd.org (Postfix) with ESMTP id 159E137B718 for ; Thu, 8 Mar 2001 13:10:15 -0800 (PST) (envelope-from jonathan@graehl.org) Received: from dickie (case.straylight.com [209.68.199.244]) by molly.straylight.com (8.11.0/8.10.0) with SMTP id f28LAAw26947 for ; Thu, 8 Mar 2001 13:10:10 -0800 From: "Jonathan Graehl" To: "Freebsd-Net" Subject: RE: [itojun@iijlab.net: accept(2) behavior with tcp RST right after handshake] Date: Thu, 8 Mar 2001 13:10:28 -0800 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0) X-MIMEOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 Importance: Normal In-Reply-To: Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org 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