Bug #6914 Updated: persistent socket connection failure
| From: | sander@php.net | Date: | Sat, 15 Dec 2001 13:29:33 +0000 |
| Subject: | Bug #6914 Updated: persistent socket connection failure | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-73912@lists.php.net to get a copy of this message | ||
ID: 6914
Updated by: sander
Reported By: wbrack@mmm.com.hk
Old Status: Feedback
Status: Closed
Bug Type: Sockets related
Operating System: Linux 2.2.17
PHP Version: 4.0.2
New Comment:
No feedback. Closing.
Previous Comments:
------------------------------------------------------------------------
[2001-11-21 12:06:14] mfischer@php.net
pfsockopen() works for me with latest RC
Can you try with latest RC and see if it works
http://www.php.net/~zeev/php-4.1.0RC3.tar.gz
Feedback.
------------------------------------------------------------------------
[2000-09-27 22:17:24] wbrack@mmm.com.hk
A UNIX socket connection is made using pfsockopen(). On the initial script entry, a message is sent
to our server and the reply is correctly received by the script. On subsequent script entries,
messages to the server are still sent successfully, but upon attempting to reply a SIGPIPE is
received by server, and the php script receives a 0-length reply to its fgets() read.
We traced the problem to ext/standard/file.c, in the routine _file_socket_dtor(). In that routine,
the macro SOCK_FCLOSE is used, which calls php_sock_close() in fsock.c. This routine correctly
handles the persistent socket. However, after that call, _file_socket_dtor() then incorrectly calls
the C routine shutdown(), which is what caused the problem. In fact, php_sock_close() already
completely takes care of the shutdown() (for the non-persistent case), so in any event the
shutdown() call in _file_socket_dtor() is not necessary.
------------------------------------------------------------------------
Edit this bug report at http://bugs.php.net/?id=6914&edit=1