]> granicus.if.org Git - php/commitdiff
Don't shutdown() unix sockets.
authorWez Furlong <wez@php.net>
Sat, 1 Mar 2003 15:22:21 +0000 (15:22 +0000)
committerWez Furlong <wez@php.net>
Sat, 1 Mar 2003 15:22:21 +0000 (15:22 +0000)
It causes the server end to close down/break.

main/streams/xp_socket.c

index 58e9e28a7c5a3f49e57014ba533840dce6506eef..79c8f677a5ec96620745f67404d96f8c6eff5bfa 100644 (file)
 #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