From: Wez Furlong Date: Sat, 1 Mar 2003 15:22:21 +0000 (+0000) Subject: Don't shutdown() unix sockets. X-Git-Tag: RELEASE_0_5~677 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=242166d601d90d8e03264f766303f51eb72f2cb9;p=php Don't shutdown() unix sockets. It causes the server end to close down/break. --- 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 #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