httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dean Gaudet <dgau...@arctic.org>
Subject RE: Bug Report 5671 - CGI Deadlock
Date Sat, 05 Feb 2000 21:19:02 GMT
in 2.0 a portable way to do this would be to spawn two threads... but that
opens a whole can of worms :)  (the portability vs. efficiency debate)

i think this is a limited application -- you're probably the first to need
full duplex cgi.  short term, you should probably do whatever works for
yourself.  it's your call.

this does tie into another topic here recently -- the "http router"
concept.  in that case the router would ideally have an asynchronous i/o
engine and you'd just hand it the fds and let it do the bit shuffling.

Dean

On Sat, 5 Feb 2000, William A. Rowe, Jr. wrote:

> Precisely, Dean.
> 
>   I'm looking at hacking a full-duplex cgi (targeting 2.0, not 1.3.x!!!)
> 
>   My metacode idea is;
> 
>   while (get inbuf <- client) {
>     write inbuf -> cgi stdinpipe
>     while (!empty cgi stdoutpipe)
>       read outbuf <- cgi stdoutpipe
>       put outbuf -> client
>   }
>   while (!empty cgi stdoutpipe)
>     read outbuf <- cgi stdoutpipe
>     put outbuf -> client
>   }
>   close client connections
> 
>   The problem I have is with the size of the pipes.  NT's are VERY small by
> default.  I discovered this with a simple CGI writing the client stream back
> at the client as a hexdump.
> 
>   Limited application?  Perhaps... but it would appear to the browser as a
> more async processes flow.  Thresholds would be required... delta time or
> size, but I'll think that through if this proves worthwhile.
> 
>   Additional thoughts anyone?
> 
> Bill
> 
> > > --- is it 'legal' to BEGIN transmitting the http result
> > > while the client is still trasmitting their request?  (Yes - I
> > > know that sounds odd, but I need to determine if the workaround is
> > > immediate transmit of response data - or some alternate queuing
> > > method to ensure the two streams don't deadlock).
> >
> > from an http point of view it's legal.  but i think you're
> > asking from the
> > point of view of a cgi ... and mod_cgi just doesn't support
> > full-duplex
> > operation.
> >
> > Dean
> >
> 
> 


Mime
View raw message