note 7355 deleted from function.fsockopen by jimw
| From: | jimw@php.net | Date: | Sat, 08 Dec 2001 21:55:59 +0000 |
| Subject: | note 7355 deleted from function.fsockopen by jimw | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-22247@lists.php.net to get a copy of this message | ||
Some servers do not close connection
by default, so if you send just
fput($fp,"HEAD / HTTP/1.1\r\nHOST: dummy\r\n\r\n");
and trying to read response by
while(!feof($fp)) { $response .= fgets($fp,128); }
fclose($fp); }
it hangs (checked for IIS/4.0, for Apache - above code is OK)
use
fputs($fp,"HEAD $FilePath HTTP/1.1\r\n");
fputs($fp,"HOST: dummy\r\n");
fputs($fp,"Connection: close\r\n\r\n");