From owner-freebsd-arch@FreeBSD.ORG Wed May 28 22:22:57 2003 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 043E937B401 for ; Wed, 28 May 2003 22:22:57 -0700 (PDT) Received: from park.rambler.ru (park.rambler.ru [81.19.64.101]) by mx1.FreeBSD.org (Postfix) with ESMTP id 09AB343F3F for ; Wed, 28 May 2003 22:22:56 -0700 (PDT) (envelope-from is@rambler-co.ru) Received: from is.park.rambler.ru (is.park.rambler.ru [81.19.64.102]) by park.rambler.ru (8.12.6/8.12.6) with ESMTP id h4T5MsmF060090; Thu, 29 May 2003 09:22:54 +0400 (MSD) Date: Thu, 29 May 2003 09:22:54 +0400 (MSD) From: Igor Sysoev X-Sender: is@is To: Terry Lambert In-Reply-To: <3ED5961E.5DE0F41B@mindspring.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: arch@freebsd.org Subject: Re: sendfile(2) SF_NOPUSH flag proposal X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 May 2003 05:22:57 -0000 On Wed, 28 May 2003, Terry Lambert wrote: > Bill Fenner wrote: > > Why not set PRUS_MORETOCOME on all but the final pru_send() call? > > If the file is larger than `sysctl net.inet.tcp.sendspace`, then > this code in do_sendfile(): > > if (sbspace(&so->so_snd) < so->so_snd.sb_lowat) { > if (so->so_state & SS_NBIO) { > m_freem(m); > sbunlock(&so->so_snd); > splx(s); > error = EAGAIN; > goto done; > } > error = sbwait(&so->so_snd); > > will result in you sleeping with PRUS_MORETOCOME set, but with > no more being sent because the send buffer doesn't get emptied, > as it's waiting for more data to send. But as I understand PRUS_MORETOCOME is not set if socket is non-blocking. Igor Sysoev http://sysoev.ru/en/