I have created attched patch using Gavin's original patch plus my changes-- adding fdwatch in cgi_interpose_output(). The timeout for read is 5000ms
-- terminating the child process if the timeout expires.
again this patch applies to uClinux-dist-20080808.On Tue, 07 Oct 2008 11:01:19 -0400, David Wu <[EMAIL PROTECTED]> wrote:
On Sun, 05 Oct 2008 19:17:49 -0400, Gavin Lambert <[EMAIL PROTECTED]> wrote:Quoth David Wu:OK. For normally CGI program(I mean exit normally) it works fine. But IfI try to call "cat kmsg" in a CGI program then it will block furtherrequest from browser. It seems there is one missing close on the socket.That's just vfork at work, isn't it? vfork blocks the execution of the parent process until the child exits or execs.IIRC, the way the patch worked was to run the actual CGI in parallel (because it was exec'd), but the output processing within the server itself blocks the main server body while waiting for output from the CGI. Admittedly not ideal, but I wasn't needing to serve multiple connections anyway so I didn't look into it further. There was a comment to that effect in the patch, I think.It is true not to serve more than one request on mmuless system.I think to sort that out the I/O interpose helper children would have to be split off into "true" separate processes that could be exec'd, which would have been quite a bit more work :)By doing that you need a new program. May I suggest:add a timer or select() or more complicated fdwatch() on CGI interpose process, if the timer expires than close that socket. The timer should be more realistic and short. I don't like it blocks all requests. Then again it may cause another error -- "Bad file descriptor"which is returned in the main process.
David Wu
thttpd.patch
Description: Binary data
_______________________________________________ uClinux-dev mailing list [email protected] http://mailman.uclinux.org/mailman/listinfo/uclinux-dev This message was resent by [email protected] To unsubscribe see: http://mailman.uclinux.org/mailman/options/uclinux-dev
