Dealing with the sendfile mess

Jeremy Allison jra at samba.org
Thu Oct 21 00:15:53 GMT 2004


On Thu, Oct 21, 2004 at 08:51:31AM +1000, Andrew Bartlett wrote:
> 
> The issue, as Steve discovered, is that on failure, our sendfile code
> will revert to a *normal* read request, despite having already sent the
> SMB header.  This means the header is sent twice, and it all goes to
> mush from here.

Is it a case of sendfile just failing ? I never got a good
report of the exact problem.

> As we discussed on IRC, there seem to be two fixes we need.  We just
> need to handle normal error cases better - file truncated under us etc,
> and the lack of a functioning sendfile() at any given moment.

Actually we don't have to handle this case, tridge proved that
returning zeros is ok here.

The returning the header twice is just a bug and we should
be able to fix that. The issue is how do we know the header
has been returned ? If the sendfile failed - where in the
returning stream did it fail ? 

Jeremy.


More information about the samba-technical mailing list