httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dean Gaudet <dgau...@arctic.org>
Subject Re: NSPR (was Re: rewritelog inefficiency)
Date Wed, 29 Apr 1998 05:49:55 GMT


On Wed, 29 Apr 1998, Wan-Teh Chang wrote:

> Dean Gaudet wrote:
> 
> > If a write() actually wrote something it always returns with the amount
> > written, this is specified actually.  To do otherwise would be absolute
> > chaos.
> 
> You might be surprised/disappointed by PR_Write's semantics.As I described
> earlier, PR_Write may consist of several write()
> calls with poll/select calls in between.  The idea is that we call
> write() repeatedly until we send the entire user buffer.  However,
> if one of the write() fails, PR_Write returns -1, even if it has written
> some bytes.

Fortunately, the apache BUFF routines do the same thing, and I can guess
you do it for some of the same reasons (simplicity).  So I'm actually used
to it.  The reason I say it'd be chaos at the kernel level is that then no
application could be written to deal exactly with write errors.  In
Apache's case a write error usually just means we're going to close the
socket and say good bye to the client. 

Dean


Mime
View raw message