summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWez Furlong <wez@php.net>2003-03-01 15:22:21 +0000
committerWez Furlong <wez@php.net>2003-03-01 15:22:21 +0000
commit242166d601d90d8e03264f766303f51eb72f2cb9 (patch)
treeba4340f5f5d9a6225722d3516c3536063e979f91
parenta3cf1ab8f6d384f35530174d45100dc3994835ba (diff)
downloadphp-git-242166d601d90d8e03264f766303f51eb72f2cb9.tar.gz
Don't shutdown() unix sockets.
It causes the server end to close down/break.
-rw-r--r--main/streams/xp_socket.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/main/streams/xp_socket.c b/main/streams/xp_socket.c
index 58e9e28a7c..79c8f677a5 100644
--- a/main/streams/xp_socket.c
+++ b/main/streams/xp_socket.c
@@ -31,6 +31,14 @@
#include <sys/un.h>
#endif
+php_stream_ops php_stream_generic_socket_ops;
+php_stream_ops php_stream_socket_ops;
+php_stream_ops php_stream_udp_socket_ops;
+#ifdef AF_UNIX
+php_stream_ops php_stream_unix_socket_ops;
+php_stream_ops php_stream_unixdg_socket_ops;
+#endif
+
static int php_tcp_sockop_set_option(php_stream *stream, int option, int value, void *ptrparam TSRMLS_DC);
@@ -134,7 +142,14 @@ static int php_sockop_close(php_stream *stream, int close_handle TSRMLS_DC)
if (sock->socket != -1) {
/* prevent more data from coming in */
- shutdown(sock->socket, SHUT_RD);
+
+#ifdef AF_UNIX
+ if (stream->ops != &php_stream_unix_socket_ops && stream->ops != &php_stream_unixdg_socket_ops) {
+#endif
+ shutdown(sock->socket, SHUT_RD);
+#ifdef AF_UNIX
+ }
+#endif
/* try to make sure that the OS sends all data before we close the connection.
* Essentially, we are waiting for the socket to become writeable, which means