httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dean Gaudet <dgau...@arctic.org>
Subject RE: errnos and buff.c
Date Fri, 18 Dec 1998 20:25:12 GMT
On Wed, 16 Dec 1998, RobS wrote:

> > - Why does bwrite() generally cause the BUFF to be emptied (e.g. even when
> > one write() might suffice to move the contents of buf into fb and
> > !chunking)?  The current approach can mean more total calls to write() and
> > more byte shifting.
> 
> Mumble. Mumble.  To be more specific (and correct)..
> 
> Effectively, the call to write_it_all() should have an nbytes arg and
> write_it_all() should check to see if it could memcpy (and update
> appropriate BUFF members) instead of continuing in the write loop.

Just how would it memcpy?  The buffer empties from the bottom, and fills
at the top.  We've already decided it was full.  If we've had a partial
write then we've got space at the bottom, not the top. 

> Effectively, the writev_it_all() call from large_write() should check to see
> if it could memcpy a section of the last segment (and update appropriate
> BUFF members) instead of continuing in hte write loop.

If this case occurs in practice then yeah we may want to optimize it.  I'm
not convinced it occurs frequently enough to be worth it (or I'm not
understanding your explanation).

Dean


Mime
View raw message