Received: by taz.hyperreal.com (8.8.4/V2.0) id OAA09596; Sat, 25 Jan 1997 14:12:15 -0800 (PST) Received: from twinlark.arctic.org by taz.hyperreal.com (8.8.4/V2.0) with SMTP id OAA09590; Sat, 25 Jan 1997 14:12:11 -0800 (PST) Received: (qmail 27417 invoked by uid 500); 25 Jan 1997 22:10:10 -0000 Date: Sat, 25 Jan 1997 14:10:10 -0800 (PST) From: Dean Gaudet To: new-httpd@apache.org Subject: chunked write discussion Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: new-httpd-owner@apache.org Precedence: bulk Reply-To: new-httpd@hyperreal.com While bcwrite() with my patch is more correct it's certainly not efficient. It causes 3 segments to be plopped on the net for each chunk. The simple fix for this is to allocate a buffer in bcwrite() and copy the stuff to be written into it and then do a single write(). But this involves an extra copy... something that'd be nice to avoid. My first idea was to fix it by using writev(), but writev() on linux (but not IRIX or Solaris) drops a segment on the wire for each vector element. (BOO HISS!) Then my next idea was to fix it by overallocating the buffer so that it has room at the beginning for the chunk header and at the end for the chunk tail. Then I read the HTTP/1.1 standard and found out that chunk sizes cannot start with extra 0 digits (BOO HISS!). It's still not hard to do it this way. Then I finally realised that if we're doing stacked disciplines for 2.0 then we're going to have that extra buffer copy anyhow. So, should I submit a patch that implements the first method (buffer copy) or the third method (overallocated buffer)? I'm not trying to get this in for 1.2b5 or even 1.2 for that matter. I don't even know how to test chunked encodings, is there a client that supports it? Dean