svn: /php/php-src/branches/PHP_5_2/ext/curl/ streams.c

From: Date: Sat, 25 Jul 2009 13:09:03 +0000
Subject: svn: /php/php-src/branches/PHP_5_2/ext/curl/ streams.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-59782@lists.php.net to get a copy of this message
jani Sat, 25 Jul 2009 13:09:03 +0000 Revision: http://svn.php.net/viewvc?view=revision&revision=284748 Log: - Merge from PHP_5_3: r280810 | kalle: Fixed compiler warnings r276286 | iliaa: Fixed bug #47477 (php_curl_stream_read() unnecessarily sleeps 15 secs under heavy load) Bug: http://bugs.php.net/47477 (Closed) [PATCH] php_curl_stream_read() unnecessarily sleeps 15 secs under heavy load Changed paths: U php/php-src/branches/PHP_5_2/ext/curl/streams.c Modified: php/php-src/branches/PHP_5_2/ext/curl/streams.c =================================================================== --- php/php-src/branches/PHP_5_2/ext/curl/streams.c 2009-07-25 13:00:25 UTC (rev 284747) +++ php/php-src/branches/PHP_5_2/ext/curl/streams.c 2009-07-25 13:09:03 UTC (rev 284748) @@ -129,7 +129,7 @@ /* our notification system only works in a single direction; we should detect which * direction is important and use the correct values in this call */ - php_stream_notify_progress(stream->context, dlnow, dltotal); + php_stream_notify_progress(stream->context, (size_t) dlnow, (size_t) dltotal); return 0; } @@ -167,7 +167,8 @@ tv.tv_sec = 15; /* TODO: allow this to be configured from the script */ /* wait for data */ - switch (select(curlstream->maxfd + 1, &curlstream->readfds, &curlstream->writefds, &curlstream->excfds, &tv)) { + switch ((curlstream->maxfd < 0) ? 1 : + select(curlstream->maxfd + 1, &curlstream->readfds, &curlstream->writefds, &curlstream->excfds, &tv)) { case -1: /* error */ return 0; @@ -180,7 +181,8 @@ curlstream->mcode = curl_multi_perform(curlstream->multi, &curlstream->pending); } while (curlstream->mcode == CURLM_CALL_MULTI_PERFORM); } - } while (curlstream->readbuffer.readpos >= curlstream->readbuffer.writepos && curlstream->pending > 0); + } while (curlstream->maxfd >= 0 && + curlstream->readbuffer.readpos >= curlstream->readbuffer.writepos && curlstream->pending > 0); }

« previous php.cvs (#59782) next »