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: 2011-02-17 20:45 UTC | 2011-02-17 20:27 UTC | 2011-02-17 19:08 UTC | 2011-02-17 18:44 UTC

Developer: seld@php.net

Line 5 (now 5), was 35 lines, now 23 lines

  @@ -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_NO_DELAY",		PHP_STREAM_CLIENT_NO_DELAY,			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)
 @@ -32,9 +32,11 @@
  #include "php_string.h"
  
  #ifndef PHP_WIN32
 +#include <netinet/tcp.h>
  #define php_select(m, r, w, e, t)	select(m, r, w, e, t)
  typedef unsigned long long php_timeout_ull;
  #else
 +#include <winsock.h>
  #include "win32/select.h"
  #include "win32/sockets.h"
  typedef unsigned __int64 php_timeout_ull;
 @@ -134,7 +136,8 @@
 @@ -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_NO_DELAY ? TCP_NODELAY : 0),
 +			(flags & PHP_STREAM_CLIENT_TCP_NODELAY ? TCP_NODELAY : 0),
   			hashkey, &tv, context, &errstr, &err);
   
   
  Index: ext/standard/streamsfuncs.h
 
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Fri Oct 07 00:05:53 2022 UTC