Re: [PHP-CVS] cvs: php-src /main/streams xp_socket.c
Because I forgot to commit it ;-) On 8-Feb-09, at 3:18 PM, Antony Dovgal wrote: On 08.02.2009 19:54, Ilia Alshanetsky wrote: iliaa Sun Feb 8 16:54:57 2009 UTC Modified files: /php-src/main/streamsxp_socket.c Log: MFB: MFB52: Fixed bug #44874 (dead pfsockopen'ed sockets aren't reaped when the remote end restarts) This looks like an ordinary bugfix to me, so why not merge it to 5_3? -- Wbr, Antony Dovgal Ilia Alshanetsky -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-CVS] cvs: php-src /main/streams xp_socket.c
On 08.02.2009 19:54, Ilia Alshanetsky wrote: > iliaa Sun Feb 8 16:54:57 2009 UTC > > Modified files: > /php-src/main/streams xp_socket.c > Log: > MFB: MFB52: Fixed bug #44874 (dead pfsockopen'ed sockets aren't reaped when > the remote end restarts) This looks like an ordinary bugfix to me, so why not merge it to 5_3? -- Wbr, Antony Dovgal -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /main/streams xp_socket.c
iliaa Sun Feb 8 16:54:57 2009 UTC Modified files: /php-src/main/streams xp_socket.c Log: MFB: MFB52: Fixed bug #44874 (dead pfsockopen'ed sockets aren't reaped when the remote end restarts) http://cvs.php.net/viewvc.cgi/php-src/main/streams/xp_socket.c?r1=1.51&r2=1.52&diff_format=u Index: php-src/main/streams/xp_socket.c diff -u php-src/main/streams/xp_socket.c:1.51 php-src/main/streams/xp_socket.c:1.52 --- php-src/main/streams/xp_socket.c:1.51 Wed Jan 7 20:19:17 2009 +++ php-src/main/streams/xp_socket.cSun Feb 8 16:54:57 2009 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: xp_socket.c,v 1.51 2009/01/07 20:19:17 felipe Exp $ */ +/* $Id: xp_socket.c,v 1.52 2009/02/08 16:54:57 iliaa Exp $ */ #include "php.h" #include "ext/standard/file.h" @@ -281,7 +281,7 @@ if (sock->socket == -1) { alive = 0; } else if (php_pollfd_for(sock->socket, PHP_POLLREADABLE|POLLPRI, &tv) > 0) { - if (0 == recv(sock->socket, &buf, sizeof(buf), MSG_PEEK) && php_socket_errno() != EWOULDBLOCK) { + if (0 >= recv(sock->socket, &buf, sizeof(buf), MSG_PEEK) && php_socket_errno() != EWOULDBLOCK) { alive = 0; } } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /main/streams xp_socket.c
iliaa Wed Feb 27 00:30:49 2008 UTC Modified files: /php-src/main/streams xp_socket.c Log: MFB: Fixed bug #44233 (MSG_PEEK undefined under BeOS R5) http://cvs.php.net/viewvc.cgi/php-src/main/streams/xp_socket.c?r1=1.43&r2=1.44&diff_format=u Index: php-src/main/streams/xp_socket.c diff -u php-src/main/streams/xp_socket.c:1.43 php-src/main/streams/xp_socket.c:1.44 --- php-src/main/streams/xp_socket.c:1.43 Mon Dec 31 07:12:19 2007 +++ php-src/main/streams/xp_socket.cWed Feb 27 00:30:49 2008 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: xp_socket.c,v 1.43 2007/12/31 07:12:19 sebastian Exp $ */ +/* $Id: xp_socket.c,v 1.44 2008/02/27 00:30:49 iliaa Exp $ */ #include "php.h" #include "ext/standard/file.h" @@ -35,6 +35,10 @@ # define MSG_DONTWAIT 0 #endif +#ifndef MSG_PEEK +# define MSG_PEEK 0 +#endif + php_stream_ops php_stream_generic_socket_ops; PHPAPI php_stream_ops php_stream_socket_ops; php_stream_ops php_stream_udp_socket_ops; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /main/streams xp_socket.c
dmitry Tue Jul 24 14:25:08 2007 UTC Modified files: /php-src/main/streams xp_socket.c Log: Fixed bug #41984 (Hangs on large SoapClient requests) http://cvs.php.net/viewvc.cgi/php-src/main/streams/xp_socket.c?r1=1.41&r2=1.42&diff_format=u Index: php-src/main/streams/xp_socket.c diff -u php-src/main/streams/xp_socket.c:1.41 php-src/main/streams/xp_socket.c:1.42 --- php-src/main/streams/xp_socket.c:1.41 Tue Jul 17 13:27:38 2007 +++ php-src/main/streams/xp_socket.cTue Jul 24 14:25:07 2007 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: xp_socket.c,v 1.41 2007/07/17 13:27:38 jani Exp $ */ +/* $Id: xp_socket.c,v 1.42 2007/07/24 14:25:07 dmitry Exp $ */ #include "php.h" #include "ext/standard/file.h" @@ -31,6 +31,10 @@ #include #endif +#ifndef MSG_DONTWAIT +# define MSG_DONTWAIT 0 +#endif + php_stream_ops php_stream_generic_socket_ops; PHPAPI php_stream_ops php_stream_socket_ops; php_stream_ops php_stream_udp_socket_ops; @@ -59,7 +63,7 @@ ptimeout = &sock->timeout; retry: - didwrite = send(sock->socket, buf, count, 0); + didwrite = send(sock->socket, buf, count, (sock->is_blocked && ptimeout) ? MSG_DONTWAIT : 0); if (didwrite <= 0) { long err = php_socket_errno(); @@ -148,7 +152,7 @@ return 0; } - nr_bytes = recv(sock->socket, buf, count, 0); + nr_bytes = recv(sock->socket, buf, count, (sock->is_blocked && sock->timeout.tv_sec != -1) ? MSG_DONTWAIT : 0); stream->eof = (nr_bytes == 0 || (nr_bytes == -1 && php_socket_errno() != EWOULDBLOCK)); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /main/streams xp_socket.c
janiTue Jul 17 13:27:39 2007 UTC Modified files: /php-src/main/streams xp_socket.c Log: - Fixed bugs #36796, #36918, #41371 (stream_set_blocking() does not work) http://cvs.php.net/viewvc.cgi/php-src/main/streams/xp_socket.c?r1=1.40&r2=1.41&diff_format=u Index: php-src/main/streams/xp_socket.c diff -u php-src/main/streams/xp_socket.c:1.40 php-src/main/streams/xp_socket.c:1.41 --- php-src/main/streams/xp_socket.c:1.40 Mon Jan 1 09:29:36 2007 +++ php-src/main/streams/xp_socket.cTue Jul 17 13:27:38 2007 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: xp_socket.c,v 1.40 2007/01/01 09:29:36 sebastian Exp $ */ +/* $Id: xp_socket.c,v 1.41 2007/07/17 13:27:38 jani Exp $ */ #include "php.h" #include "ext/standard/file.h" @@ -281,18 +281,11 @@ } case PHP_STREAM_OPTION_BLOCKING: - oldmode = sock->is_blocked; - - /* no need to change anything */ - if (value == oldmode) - return oldmode; - if (SUCCESS == php_set_sock_blocking(sock->socket, value TSRMLS_CC)) { sock->is_blocked = value; return oldmode; } - return PHP_STREAM_OPTION_RETURN_ERR; case PHP_STREAM_OPTION_READ_TIMEOUT: @@ -751,11 +744,8 @@ /* fall through */ ; } - - /* fall through */ - default: - return php_sockop_set_option(stream, option, value, ptrparam TSRMLS_CC); } + return php_sockop_set_option(stream, option, value, ptrparam TSRMLS_CC); } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /main/streams xp_socket.c
tony2001Thu Dec 21 01:07:52 2006 UTC Modified files: /php-src/main/streams xp_socket.c Log: don't leak on error http://cvs.php.net/viewvc.cgi/php-src/main/streams/xp_socket.c?r1=1.38&r2=1.39&diff_format=u Index: php-src/main/streams/xp_socket.c diff -u php-src/main/streams/xp_socket.c:1.38 php-src/main/streams/xp_socket.c:1.39 --- php-src/main/streams/xp_socket.c:1.38 Tue Dec 19 08:59:26 2006 +++ php-src/main/streams/xp_socket.cThu Dec 21 01:07:52 2006 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: xp_socket.c,v 1.38 2006/12/19 08:59:26 dmitry Exp $ */ +/* $Id: xp_socket.c,v 1.39 2006/12/21 01:07:52 tony2001 Exp $ */ #include "php.h" #include "ext/standard/file.h" @@ -642,6 +642,7 @@ if (xparam->want_errortext) { spprintf(&xparam->outputs.error_text, 0, "local_addr context option is not a string."); } + efree(host); return -1; } bindto = parse_ip_address_ex(Z_STRVAL_PP(tmpzval), Z_STRLEN_PP(tmpzval), &bindport, xparam->want_errortext, &xparam->outputs.error_text TSRMLS_CC); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /main/streams xp_socket.c
pollita Thu Feb 2 18:16:25 2006 UTC Modified files: /php-src/main/streams xp_socket.c Log: Prevent bindport from being used uninitialized http://cvs.php.net/viewcvs.cgi/php-src/main/streams/xp_socket.c?r1=1.34&r2=1.35&diff_format=u Index: php-src/main/streams/xp_socket.c diff -u php-src/main/streams/xp_socket.c:1.34 php-src/main/streams/xp_socket.c:1.35 --- php-src/main/streams/xp_socket.c:1.34 Sun Jan 1 13:09:57 2006 +++ php-src/main/streams/xp_socket.cThu Feb 2 18:16:25 2006 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: xp_socket.c,v 1.34 2006/01/01 13:09:57 sniper Exp $ */ +/* $Id: xp_socket.c,v 1.35 2006/02/02 18:16:25 pollita Exp $ */ #include "php.h" #include "ext/standard/file.h" @@ -578,7 +578,7 @@ php_stream_xport_param *xparam TSRMLS_DC) { char *host = NULL, *bindto = NULL; - int portno, bindport; + int portno, bindport = 0; int err; int ret; zval **tmpzval = NULL; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /main/streams xp_socket.c
sebastian Tue Jun 14 01:13:02 2005 EDT Modified files: /php-src/main/streams xp_socket.c Log: ZTS fix. http://cvs.php.net/diff.php/php-src/main/streams/xp_socket.c?r1=1.31&r2=1.32&ty=u Index: php-src/main/streams/xp_socket.c diff -u php-src/main/streams/xp_socket.c:1.31 php-src/main/streams/xp_socket.c:1.32 --- php-src/main/streams/xp_socket.c:1.31 Mon Jun 13 22:39:42 2005 +++ php-src/main/streams/xp_socket.cTue Jun 14 01:13:01 2005 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: xp_socket.c,v 1.31 2005/06/14 02:39:42 iliaa Exp $ */ +/* $Id: xp_socket.c,v 1.32 2005/06/14 05:13:01 sebastian Exp $ */ #include "php.h" #include "ext/standard/file.h" @@ -525,7 +525,7 @@ static inline char *parse_ip_address(php_stream_xport_param *xparam, int *portno TSRMLS_DC) { - return parse_ip_address_ex(xparam->inputs.name, xparam->inputs.namelen, portno, xparam->want_errortext, &xparam->outputs.error_text); + return parse_ip_address_ex(xparam->inputs.name, xparam->inputs.namelen, portno, xparam->want_errortext, &xparam->outputs.error_text TSRMLS_CC); } static inline int php_tcp_sockop_bind(php_stream *stream, php_netstream_data_t *sock, -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /main/streams xp_socket.c
iliaa Sun Aug 22 14:05:25 2004 EDT Modified files: /php-src/main/streams xp_socket.c Log: Using int when long should be used. http://cvs.php.net/diff.php/php-src/main/streams/xp_socket.c?r1=1.27&r2=1.28&ty=u Index: php-src/main/streams/xp_socket.c diff -u php-src/main/streams/xp_socket.c:1.27 php-src/main/streams/xp_socket.c:1.28 --- php-src/main/streams/xp_socket.c:1.27 Tue Aug 10 09:44:43 2004 +++ php-src/main/streams/xp_socket.cSun Aug 22 14:05:24 2004 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: xp_socket.c,v 1.27 2004/08/10 13:44:43 wez Exp $ */ +/* $Id: xp_socket.c,v 1.28 2004/08/22 18:05:24 iliaa Exp $ */ #include "php.h" #include "ext/standard/file.h" @@ -93,7 +93,7 @@ } while (err == EINTR); } estr = php_socket_strerror(err, NULL, 0); - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "send of %ld bytes failed with errno=%d %s", + php_error_docref(NULL TSRMLS_CC, E_NOTICE, "send of %ld bytes failed with errno=%ld %s", (long)count, err, estr); efree(estr); } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /main/streams xp_socket.c
wez Tue Aug 10 09:44:43 2004 EDT Modified files: /php-src/main/streams xp_socket.c Log: Fix for #29256 from Dmitry, very slightly modified http://cvs.php.net/diff.php/php-src/main/streams/xp_socket.c?r1=1.26&r2=1.27&ty=u Index: php-src/main/streams/xp_socket.c diff -u php-src/main/streams/xp_socket.c:1.26 php-src/main/streams/xp_socket.c:1.27 --- php-src/main/streams/xp_socket.c:1.26 Sat Jul 31 12:34:44 2004 +++ php-src/main/streams/xp_socket.cTue Aug 10 09:44:43 2004 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: xp_socket.c,v 1.26 2004/07/31 16:34:44 wez Exp $ */ +/* $Id: xp_socket.c,v 1.27 2004/08/10 13:44:43 wez Exp $ */ #include "php.h" #include "ext/standard/file.h" @@ -52,13 +52,49 @@ return 0; } +retry: didwrite = send(sock->socket, buf, count, 0); if (didwrite <= 0) { - char *estr = php_socket_strerror(php_socket_errno(), NULL, 0); + long err = php_socket_errno(); + char *estr; + if (sock->is_blocked && err == EWOULDBLOCK) { + fd_set fdw, tfdw; + int retval; + struct timeval timeout, *ptimeout; + + FD_ZERO(&fdw); + FD_SET(sock->socket, &fdw); + sock->timeout_event = 0; + + if (sock->timeout.tv_sec == -1) + ptimeout = NULL; + else + ptimeout = &timeout; + + do { + tfdw = fdw; + timeout = sock->timeout; + + retval = select(sock->socket + 1, NULL, &tfdw, NULL, ptimeout); + + if (retval == 0) { + sock->timeout_event = 1; + break; + } + + if (retval > 0) { + /* writable now; retry */ + goto retry; + } + + err = php_socket_errno(); + } while (err == EINTR); + } + estr = php_socket_strerror(err, NULL, 0); php_error_docref(NULL TSRMLS_CC, E_NOTICE, "send of %ld bytes failed with errno=%d %s", - (long)count, php_socket_errno(), estr); + (long)count, err, estr); efree(estr); } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /main/streams xp_socket.c
wez Sat Jul 31 12:34:45 2004 EDT Modified files: /php-src/main/streams xp_socket.c Log: zts fix... http://cvs.php.net/diff.php/php-src/main/streams/xp_socket.c?r1=1.25&r2=1.26&ty=u Index: php-src/main/streams/xp_socket.c diff -u php-src/main/streams/xp_socket.c:1.25 php-src/main/streams/xp_socket.c:1.26 --- php-src/main/streams/xp_socket.c:1.25 Sat Jul 31 06:56:55 2004 +++ php-src/main/streams/xp_socket.cSat Jul 31 12:34:44 2004 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: xp_socket.c,v 1.25 2004/07/31 10:56:55 wez Exp $ */ +/* $Id: xp_socket.c,v 1.26 2004/07/31 16:34:44 wez Exp $ */ #include "php.h" #include "ext/standard/file.h" @@ -331,7 +331,7 @@ xparam->inputs.buf, xparam->inputs.buflen, flags, xparam->inputs.addr, - xparam->inputs.addrlen); + xparam->inputs.addrlen TSRMLS_CC); if (xparam->outputs.returncode == -1) { char *err = php_socket_strerror(php_socket_errno(), NULL, 0); php_error_docref(NULL TSRMLS_CC, E_WARNING, -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /main/streams xp_socket.c
wez Sat Jul 31 06:49:10 2004 EDT Modified files: /php-src/main/streams xp_socket.c Log: Make sure this is initialized... http://cvs.php.net/diff.php/php-src/main/streams/xp_socket.c?r1=1.23&r2=1.24&ty=u Index: php-src/main/streams/xp_socket.c diff -u php-src/main/streams/xp_socket.c:1.23 php-src/main/streams/xp_socket.c:1.24 --- php-src/main/streams/xp_socket.c:1.23 Mon Mar 8 18:11:45 2004 +++ php-src/main/streams/xp_socket.cSat Jul 31 06:49:09 2004 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: xp_socket.c,v 1.23 2004/03/08 23:11:45 abies Exp $ */ +/* $Id: xp_socket.c,v 1.24 2004/07/31 10:49:09 wez Exp $ */ #include "php.h" #include "ext/standard/file.h" @@ -233,11 +233,13 @@ if (value == -1) { if (sock->timeout.tv_sec == -1) { tv.tv_sec = FG(default_socket_timeout); + tv.tv_usec = 0; } else { tv = sock->timeout; } } else { tv.tv_sec = value; + tv.tv_usec = 0; } if (sock->socket == -1) { -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /main/streams xp_socket.c
wez Tue Dec 2 11:35:20 2003 EDT Modified files: /php-src/main/streams xp_socket.c Log: this can't be persistent Index: php-src/main/streams/xp_socket.c diff -u php-src/main/streams/xp_socket.c:1.19 php-src/main/streams/xp_socket.c:1.20 --- php-src/main/streams/xp_socket.c:1.19 Sun Nov 30 14:43:30 2003 +++ php-src/main/streams/xp_socket.cTue Dec 2 11:35:19 2003 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: xp_socket.c,v 1.19 2003/11/30 19:43:30 iliaa Exp $ */ +/* $Id: xp_socket.c,v 1.20 2003/12/02 16:35:19 wez Exp $ */ #include "php.h" #include "ext/standard/file.h" @@ -632,7 +632,7 @@ if (clisock >= 0) { php_netstream_data_t *clisockdata; - clisockdata = pemalloc(sizeof(*clisockdata), stream->is_persistent); + clisockdata = emalloc(sizeof(*clisockdata)); if (clisockdata == NULL) { close(clisock); @@ -643,6 +643,7 @@ xparam->outputs.client = php_stream_alloc_rel(stream->ops, clisockdata, NULL, "r+"); if (xparam->outputs.client) { + /* TODO: addref ? */ xparam->outputs.client->context = stream->context; } } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php