Received: by taz.hyperreal.com (8.7.6/V2.0) id PAA12585; Sun, 3 Nov 1996 15:43:19 -0800 (PST) Received: from blacklodge.c2.net by taz.hyperreal.com (8.7.6/V2.0) with ESMTP id PAA12578; Sun, 3 Nov 1996 15:43:16 -0800 (PST) Received: from atropos.c2.org (atropos.c2.org [140.174.185.14]) by blacklodge.c2.net (8.7.6/8.7.3) with ESMTP id PAA08517 for ; Sun, 3 Nov 1996 15:43:17 -0800 (PST) From: sameer Received: (from sameer@localhost) by atropos.c2.org (8.7.6/8.7.3) id PAA04517 for new-httpd@hyperreal.com; Sun, 3 Nov 1996 15:43:14 -0800 (PST) Message-Id: <199611032343.PAA04517@atropos.c2.org> Subject: Making CGI "unbuffered" To: new-httpd@hyperreal.com Date: Sun, 3 Nov 1996 15:43:14 -0800 (PST) X-Mailer: ELM [version 2.4 PL24 ME8a] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-new-httpd@apache.org Precedence: bulk Reply-To: new-httpd@hyperreal.com From Mark Brown's suggestions I realized that the only thing one really needs to do is make the reads from the CGI non-blocking. I've patched up stuff so that this is doable. The patches aren't quite clean yet, but I was wondering if people think I did "the right thing" and could offer suggestions about better ways to do things. 1) I modified spawn_child, and created a new spawn_child_buff, which makes script_in and script_out BUFF *, rather than FILE *.. would it be a good idea to change the spawn_child API to take BUFF, or is the new function the better idea? It seems cleaner to change the API to use BUFF *, but that would break old modules. 2) I modified other things to appropriately deal with the fact that those two things are BUFF * rather than FILE *. 3) I created send_fb, which is similar to send_fd, except it takes a BUFF * rather than a FILE *. send_fb clears out the existing read buffer from the BUFF * and then makes the fd nonblocking, and enters a select/read loop to get all the data out of it. I'll send a patch along in my next email. (I'm not submitting this patch for review/commit, it needs work, and it is against 1.1.1, not 1.2dev. I'm just submitting it for review) -- Sameer Parekh Voice: 510-986-8770 C2Net FAX: 510-986-8777 The Internet Privacy Provider http://www.c2.net/ sameer@c2.net