cvs: php-src /main/streams xp_socket.c

From: Date: Tue, 24 Jul 2007 14:25:08 +0000
Subject: cvs: php-src /main/streams xp_socket.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-45579@lists.php.net to get a copy of this message
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.c Tue 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 <sys/un.h> #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));

« previous php.cvs (#45579) next »