wez             Sat Mar  1 10:22:21 2003 EDT

  Modified files:              
    /php4/main/streams  xp_socket.c 
  Log:
  Don't shutdown() unix sockets.
  It causes the server end to close down/break.
  
  
Index: php4/main/streams/xp_socket.c
diff -u php4/main/streams/xp_socket.c:1.5 php4/main/streams/xp_socket.c:1.6
--- php4/main/streams/xp_socket.c:1.5   Fri Feb 28 16:03:36 2003
+++ php4/main/streams/xp_socket.c       Sat Mar  1 10:22:21 2003
@@ -16,7 +16,7 @@
   +----------------------------------------------------------------------+
 */
 
-/* $Id: xp_socket.c,v 1.5 2003/02/28 21:03:36 wez Exp $ */
+/* $Id: xp_socket.c,v 1.6 2003/03/01 15:22:21 wez Exp $ */
 
 #include "php.h"
 #include "ext/standard/file.h"
@@ -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 @@
 
                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



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to