cvs: php4(PHP_4_3) /main network.c
| From: | Sascha Schumann | Date: | Tue, 06 May 2003 14:39:32 +0000 |
| Subject: | cvs: php4(PHP_4_3) /main network.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-20740@lists.php.net to get a copy of this message | ||
sas Tue May 6 10:39:32 2003 EDT
Modified files: (Branch: PHP_4_3)
/php4/main network.c
Log:
Eliminate fsync calls which apply to files, not sockets.
Also disable the Win32 socket shutdown procedure for non-Win32 systems.
closesocket has quite different semantics on Win32 which requires
a certain shutdown procedure as outlined here:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winsock/winsock/shutdown_2.asp
Index: php4/main/network.c
diff -u php4/main/network.c:1.83.2.6 php4/main/network.c:1.83.2.7
--- php4/main/network.c:1.83.2.6 Sat Apr 26 17:34:48 2003
+++ php4/main/network.c Tue May 6 10:39:31 2003
@@ -16,7 +16,7 @@
| Streams work by Wez Furlong <wez@thebrainroom.com> |
+----------------------------------------------------------------------+
*/
-/* $Id: network.c,v 1.83.2.6 2003/04/26 21:34:48 wez Exp $ */
+/* $Id: network.c,v 1.83.2.7 2003/05/06 14:39:31 sas Exp $ */
/*#define DEBUG_MAIN_NETWORK 1*/
@@ -1031,6 +1031,7 @@
}
#endif
+#ifdef PHP_WIN32
/* prevent more data from coming in */
shutdown(sock->socket, SHUT_RD);
@@ -1050,6 +1051,7 @@
n = select(sock->socket + 1, NULL, &wrfds, &efds, &timeout);
} while (n == -1 && php_socket_errno() == EINTR);
+#endif
closesocket(sock->socket);
@@ -1060,12 +1062,6 @@
return 0;
}
-static int php_sockop_flush(php_stream *stream TSRMLS_DC)
-{
- php_netstream_data_t *sock = (php_netstream_data_t*)stream->abstract;
- return fsync(sock->socket);
-}
-
static int php_sockop_stat(php_stream *stream, php_stream_statbuf *ssb TSRMLS_DC)
{
php_netstream_data_t *sock = (php_netstream_data_t*)stream->abstract;
@@ -1136,7 +1132,7 @@
php_stream_ops php_stream_socket_ops = {
php_sockop_write, php_sockop_read,
- php_sockop_close, php_sockop_flush,
+ php_sockop_close, NULL,
"socket",
NULL, /* seek */
php_sockop_cast,