cgi bg

cgi bg

Eli Billauer eli at billauer.co.il
Mon Aug 25 10:59:06 IDT 2014


Hi,

As far as I recall, the connection closes only when the cgi script's 
stdout closes, which is usually when the script terminates.

If you fork() the process or just go on doing stuff, a file handle 
attached to stdout remains open, which is probably why the HTTP 
connection remains open.

I suggest trying to close stdout when you're done with the HTTP response.

Regards,
    Eli

On 25/08/14 10:25, Erez D wrote:
> hi
>
> i have a php cgi scripts that
> 1. generates an http response , this takes less than a second
> 2. do some stuff that may take some time, lets say a minute
>
> when posting to that cgi, although the html is returned in less then a 
> second, the request is not closed until the minute has passed.
>
> i want the http transaction to be closed when done (i.e. less than a 
> minute)
> but the php script to continue it's action (e.g. the minute it takes)
>
> can i do it in php ? i.e. flush, or send eof, which will finish the 
> request but leave the php running until done ?
>
>
> thanks
> erez
>
>
> _______________________________________________
> Linux-il mailing list
> Linux-il at cs.huji.ac.il
> http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il
>    




More information about the Linux-il mailing list