Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 05 Nov 2007 07:01:49 +0200
From:      Ian FREISLICH <ianf@clue.co.za>
To:        Robert Watson <rwatson@FreeBSD.org>
Cc:        current@freebsd.org
Subject:   Re: sendfile() not detecting closed connections. 
Message-ID:  <E1Iou5t-0000UY-KK@clue.co.za>
In-Reply-To: Message from Robert Watson <rwatson@FreeBSD.org> of "Fri, 02 Nov 2007 16:26:45 %2B0100." <20071102162523.A47979@fledge.watson.org> 

next in thread | previous in thread | raw e-mail | index | archive | help
Robert Watson wrote:
> On Fri, 2 Nov 2007, Ian FREISLICH wrote:
> > sendfile() reports success for files less than about 64k in size,
> > but I haven't been able to figure out where the threshold is.  It
> > erroneously reports that 41000 of the 64k were sent, but will say
> > the whole file was transferred up to about 64k.  The connection
> > filedescriptor is blocking.
>
> Probably what is happening is that sendfile() is counting bytes
> successfully inserted into the send socket buffer, rather than bytes
> sent on the wire.  This is consistent with what happens when you
> write a file to a TCP socket, though, as you only know the bytes made
> it into the buffer, not to the remote destination.  I'd guess the
> threshold size you're seeing above is the size of the default send
> socket buffer.

The connection was closed long before the call to sendfile by the
remote side.  Is there a way to determine how much actually made
it onto the wire?  Presumably this is actually known somewhere in
the kernel.

Ian

--
Ian Freislich




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?E1Iou5t-0000UY-KK>