php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Return to Bug #51879
Patch add-tcp-nodelay revision 2011-02-17 20:45 UTC by seld@php.net
revision 2011-02-17 20:27 UTC by seld@php.net
revision 2011-02-17 19:08 UTC by seld@php.net
revision 2011-02-17 18:44 UTC by seld@php.net

Patch add-tcp-nodelay for Streams related Bug #51879

Patch version 2011-02-17 19:08 UTC

Return to Bug #51879 | Download this patch
This patch is obsolete

Obsoleted by patches:

This patch renders other patches obsolete

Obsolete patches:

Patch Revisions:

Developer: seld@php.net

Index: ext/standard/file.c
===================================================================
--- ext/standard/file.c	(revision 308439)
+++ ext/standard/file.c	(working copy)
@@ -217,6 +217,7 @@
 	REGISTER_LONG_CONSTANT("STREAM_CLIENT_PERSISTENT",		PHP_STREAM_CLIENT_PERSISTENT,		CONST_CS | CONST_PERSISTENT);
 	REGISTER_LONG_CONSTANT("STREAM_CLIENT_ASYNC_CONNECT",	PHP_STREAM_CLIENT_ASYNC_CONNECT,	CONST_CS | CONST_PERSISTENT);
 	REGISTER_LONG_CONSTANT("STREAM_CLIENT_CONNECT",			PHP_STREAM_CLIENT_CONNECT,	CONST_CS | CONST_PERSISTENT);
+	REGISTER_LONG_CONSTANT("STREAM_CLIENT_TCP_NODELAY",		PHP_STREAM_CLIENT_TCP_NODELAY,		CONST_CS | CONST_PERSISTENT);
 
 	REGISTER_LONG_CONSTANT("STREAM_CRYPTO_METHOD_SSLv2_CLIENT",		STREAM_CRYPTO_METHOD_SSLv2_CLIENT,	CONST_CS|CONST_PERSISTENT);
 	REGISTER_LONG_CONSTANT("STREAM_CRYPTO_METHOD_SSLv3_CLIENT",		STREAM_CRYPTO_METHOD_SSLv3_CLIENT,	CONST_CS|CONST_PERSISTENT);
Index: ext/standard/streamsfuncs.c
===================================================================
--- ext/standard/streamsfuncs.c	(revision 308439)
+++ ext/standard/streamsfuncs.c	(working copy)
@@ -134,7 +134,8 @@
 
 	stream = php_stream_xport_create(host, host_len, ENFORCE_SAFE_MODE | REPORT_ERRORS,
 			STREAM_XPORT_CLIENT | (flags & PHP_STREAM_CLIENT_CONNECT ? STREAM_XPORT_CONNECT : 0) |
-			(flags & PHP_STREAM_CLIENT_ASYNC_CONNECT ? STREAM_XPORT_CONNECT_ASYNC : 0),
+			(flags & PHP_STREAM_CLIENT_ASYNC_CONNECT ? STREAM_XPORT_CONNECT_ASYNC : 0) |
+			(flags & PHP_STREAM_CLIENT_TCP_NODELAY ? TCP_NODELAY : 0),
 			hashkey, &tv, context, &errstr, &err);
 
 
Index: ext/standard/streamsfuncs.h
===================================================================
--- ext/standard/streamsfuncs.h	(revision 308439)
+++ ext/standard/streamsfuncs.h	(working copy)
@@ -22,6 +22,7 @@
 #define PHP_STREAM_CLIENT_PERSISTENT	1
 #define PHP_STREAM_CLIENT_ASYNC_CONNECT	2
 #define PHP_STREAM_CLIENT_CONNECT		4
+#define PHP_STREAM_CLIENT_NO_DELAY	8
 
 PHP_FUNCTION(stream_socket_client);
 PHP_FUNCTION(stream_socket_server);
 
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Tue Aug 16 16:05:44 2022 UTC