#! /usr/bin/perl
print "Location:http://example.com/\n\n";
close(STDOUT); close(STDIN); close(STDERR);
[some long process]
#! /usr/bin/perl
print "Location:http://mydomain/\n\n";
close(STDOUT); close(STDIN); close(STDERR);
[some long process]
I tried doing a "print Location" to a .cgi file on another domain, that does a "print Location" right back to a page on the target domain, but that doesn't work either -- the browser still stalls.
I know the server isn't tied up because while [some long process] is executing, I can still load pages from that domain the script is on in another browser window.
http://example.com/test3.cgi
GET /test3.cgi HTTP/1.1
Host: example.com
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:18.0) Gecko/20100101 Firefox/18.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Connection: keep-alive
HTTP/1.1 302 Found
Date: Sun, 27 Jan 2013 23:31:49 GMT
Server: Apache
Location: http://example.com/
Vary: Accept-Encoding
Content-Encoding: gzip
Content-Length: 187
Keep-Alive: timeout=2, max=100
Connection: Keep-Alive
Content-Type: text/html; charset=iso-8859-1
http://example.com/
GET / HTTP/1.1
Host: example.com
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:18.0) Gecko/20100101 Firefox/18.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Connection: keep-alive
HTTP/1.1 200 OK
Date: Sun, 27 Jan 2013 23:31:54 GMT
Server: Apache
Accept-Ranges: bytes
X-Mod-Pagespeed: 0.10.21.2-1381
Vary: Accept-Encoding
Content-Encoding: gzip
MS-Author-Via: DAV
Cache-Control: max-age=0, no-cache
Content-Length: 12189
Keep-Alive: timeout=2, max=99
Connection: Keep-Alive
Content-Type: text/html
#! /usr/bin/perl
if ($pid = fork) { }
else {
close STDOUT();
open(FILE,'>test.txt');
print FILE time;
close(FILE);
exit(0);
}
print "Location: http://mydomain.com/\n\n";