Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 29 May 2003 09:22:54 +0400 (MSD)
From:      Igor Sysoev <is@rambler-co.ru>
To:        Terry Lambert <tlambert2@mindspring.com>
Cc:        arch@freebsd.org
Subject:   Re: sendfile(2) SF_NOPUSH flag proposal
Message-ID:  <Pine.BSF.4.21.0305290922350.51958-100000@is>
In-Reply-To: <3ED5961E.5DE0F41B@mindspring.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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/



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.21.0305290922350.51958-100000>