com php-src: Merge branch 'PHP-5.6': main/streams/xp_socket .c
| From: | rdlowrey@php.net | Date: | Wed, 06 Aug 2014 02:58:45 +0000 |
| Subject: | com php-src: Merge branch 'PHP-5.6': main/streams/xp_socket .c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-79741@lists.php.net to get a copy of this message | ||
Commit: f6b530bd5431dbf64a84598014f7cce16daa9350
Author: Daniel Lowrey <rdlowrey@php.net> Tue, 5 Aug 2014 22:58:45 -0400
Parents: 1b5569eb16a07df7806bdb4b4060d355656683e8 60552a887104e83c7e6425f0625ffa9d19e5a8dc
Branches: master
Link: http://git.php.net/?p=php-src..git;a=commitdiff;h=f6b530bd5431dbf64a84598014f7cce16daa9350
Log:
Merge branch 'PHP-5.6'
Changed paths:
MM main/streams/xp_socket.c
Diff:
diff --cc main/streams/xp_socket.c
index a6dc115,c7b5a70..b4eda4b
--- a/main/streams/xp_socket.c
+++ b/main/streams/xp_socket.c
@@@ -599,8 -601,28 +601,28 @@@ static inline int php_tcp_sockop_bind(p
return -1;
}
+ #ifdef SO_REUSEPORT
+ if (stream->context
+ && php_stream_context_get_option(stream->context, "socket",
"so_reuseport", &tmpzval) == SUCCESS
- && zend_is_true(*tmpzval)
++ && zend_is_true(*tmpzval TSRMLS_CC)
+ ) {
+ 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)
++ && zend_is_true(*tmpzval TSRMLS_CC)
+ ) {
+ 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);
@@@ -665,6 -688,16 +688,16 @@@ static inline int php_tcp_sockop_connec
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)
++ && zend_is_true(*tmpzval TSRMLS_CC)
+ ) {
+ 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.. */