In article <[EMAIL PROTECTED]> , [EMAIL PROTECTED] (Alex Elderson) wrote:
>open connection to webapps.hardinxveld.netflex.nl oke > > get / done > get / failt > >Closing connection to webapps.hardinxveld.netflex.nl oke > > >The problem is the "Connection: Close\n\n" header. The webserver close the >connection after the first request, if i remove >the "Connection: Close\n\n" header the first fgets($web_conn, 128) command >will never ends. > >It's running on winXP apache 2.0.36 PHP 4.2.1 (test server) from the shell First of all, you need to be aware that a web-server is not required to respond using HTTP/1.1 just because you asked for it... If the web-server don't feel like doing HTTP/1.1, it can fall back to HTTP/1.0 in its response. [At least, that's how I understand it...] So this whole multiple-file thingie may not work if, as I suspect, HTTP/1.0 doesn't support multiple files in one connection. Secondly, I think it's probably just a Bad Idea (tm) to try to force HTTP to do 2 files in one connection anyway -- It just complicates your life, and is giving you headaches already... How much worse will it get in a year? That said, I suspect that fgets() is looking for a particular character all by itself on a line that determines the end of a file. Control-D, possibly. So, *MAYBE* sending a chr(4) (control-D) after each file will work... Even if it does work, I still think it's a Bad Idea -- I'm not sure fgets() is DOCUMENTED to use the Control-D, so there's no guarantee it will keep working. More headaches next week/month/year. Disclaimer: I'm not promising any of this is correct -- mostly guess-work here. -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php