|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2004-07-02 19:27 UTC] wez@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Nov 15 19:00:01 2025 UTC |
Description: ------------ When using fsockopen with non "available" unix socket, fsockopen returns FALSE (no file descriptor), but an unix socket remains opened in webserver process running php. run watch -n 1 'lsof -U | grep ^apache | wc -l' while opening the following page (replacing "apache" by the real name of your webserver). Suggestion : in file main/network.c, in function _php_stream_sock_open_unix, when php_connect_nonb fails, closesocket(socketd) should be invoked before returning NULL. Reproduce code: --------------- <?php $PHPfd = fsockopen("/dev/null", 0, $PHPerrno, $PHPerrstr); if($PHPfd) { fclose($PHPfd); } ?> <html><head><title>fsockopen</title></head> <body> <pre> PID : <?php print getmypid() . " ". $PHPerrstr . "."; ?> </pre> </body></html> Expected result: ---------------- When fsockopen returns FALSE, no file descriptor created by this function should remain opened