diff options
author | Ferenc Kovacs <tyrael@php.net> | 2014-08-06 20:33:48 +0200 |
---|---|---|
committer | Ferenc Kovacs <tyrael@php.net> | 2014-08-06 20:33:48 +0200 |
commit | 791c87ae484e71316c61808be5b324290dc9bd67 (patch) | |
tree | f543efd241e9ee0789f175e7507a126f87d42a2e /main/streams/xp_socket.c | |
parent | 847c65e9672072fd772d08a78d653b6142b6c4f0 (diff) | |
download | php-git-791c87ae484e71316c61808be5b324290dc9bd67.tar.gz |
Revert "Add SO_REUSEPORT + SO_BROADCAST support via socket stream context option"
This reverts commit a51bf0cadf7862d10b2cc19cae2c991d24d670b1.
Diffstat (limited to 'main/streams/xp_socket.c')
-rw-r--r-- | main/streams/xp_socket.c | 36 |
1 files changed, 1 insertions, 35 deletions
diff --git a/main/streams/xp_socket.c b/main/streams/xp_socket.c index c7b5a7098d..a6dc115962 100644 --- a/main/streams/xp_socket.c +++ b/main/streams/xp_socket.c @@ -570,8 +570,6 @@ static inline int php_tcp_sockop_bind(php_stream *stream, php_netstream_data_t * { char *host = NULL; int portno, err; - long sockopts = STREAM_SOCKOP_NONE; - zval **tmpzval = NULL; #ifdef AF_UNIX if (stream->ops == &php_stream_unix_socket_ops || stream->ops == &php_stream_unixdg_socket_ops) { @@ -601,28 +599,8 @@ static inline int php_tcp_sockop_bind(php_stream *stream, php_netstream_data_t * return -1; } -#ifdef SO_REUSEPORT - if (stream->context - && php_stream_context_get_option(stream->context, "socket", "so_reuseport", &tmpzval) == SUCCESS - && zend_is_true(*tmpzval) - ) { - sockopts |= STREAM_SOCKOP_SO_REUSEPORT; - } -#endif - -#ifdef SO_BROADCAST - if (&php_stream_udp_socket_ops /* SO_BROADCAST is only applicable for UDP */ - && stream->context - && php_stream_context_get_option(stream->context, "socket", "so_broadcast", &tmpzval) == SUCCESS - && zend_is_true(*tmpzval) - ) { - sockopts |= STREAM_SOCKOP_SO_BROADCAST; - } -#endif - sock->socket = php_network_bind_socket_to_local_addr(host, portno, stream->ops == &php_stream_udp_socket_ops ? SOCK_DGRAM : SOCK_STREAM, - sockopts, xparam->want_errortext ? &xparam->outputs.error_text : NULL, &err TSRMLS_CC); @@ -642,7 +620,6 @@ static inline int php_tcp_sockop_connect(php_stream *stream, php_netstream_data_ int err = 0; int ret; zval **tmpzval = NULL; - long sockopts = STREAM_SOCKOP_NONE; #ifdef AF_UNIX if (stream->ops == &php_stream_unix_socket_ops || stream->ops == &php_stream_unixdg_socket_ops) { @@ -688,16 +665,6 @@ static inline int php_tcp_sockop_connect(php_stream *stream, php_netstream_data_ bindto = parse_ip_address_ex(Z_STRVAL_PP(tmpzval), Z_STRLEN_PP(tmpzval), &bindport, xparam->want_errortext, &xparam->outputs.error_text TSRMLS_CC); } -#ifdef SO_BROADCAST - if (&php_stream_udp_socket_ops /* SO_BROADCAST is only applicable for UDP */ - && stream->context - && php_stream_context_get_option(stream->context, "socket", "so_broadcast", &tmpzval) == SUCCESS - && zend_is_true(*tmpzval) - ) { - sockopts |= STREAM_SOCKOP_SO_BROADCAST; - } -#endif - /* Note: the test here for php_stream_udp_socket_ops is important, because we * want the default to be TCP sockets so that the openssl extension can * re-use this code. */ @@ -709,8 +676,7 @@ static inline int php_tcp_sockop_connect(php_stream *stream, php_netstream_data_ xparam->want_errortext ? &xparam->outputs.error_text : NULL, &err, bindto, - bindport, - sockopts + bindport TSRMLS_CC); ret = sock->socket == -1 ? -1 : 0; |