This patch eliminates all "wasteful" bflush() calls and
attempts to be as efficient with write()s as possible without making the code too ugly. Essentially it makes the chunk header and trailer a part of the output buffer, and maintains enough state in the BUFF to be able to fix up the header when it is ready to flush the chunk. It uses writev() when it's not efficient for us to buffer a large write -- i.e. a bwrite() of a large block will first fill the buffer, and chunk that, then if the remaining part is larger than bufsiz it will be chunked without first copying it to a buffer. I added NO_WRITEV which should be defined on platforms that do not have writev(). They will experience a performance penalty on those large writes, but that's just too bad. A keen porter could implement a writev() that did userland copying to assemble a single write(). For now, NO_WRITEV is not defined anywhere. Submitted by: Dean Gaudet Reviewed by: Roy Fielding, Randy Terbush, Chuck Murcko, Jim Jagielski git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/1.3.x@77596 13f79535-47bb-0310-9956-ffa450edef68
Please register or sign in to comment