summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPierrick Charron <pierrick@php.net>2012-09-28 15:19:03 -0400
committerPierrick Charron <pierrick@php.net>2012-09-28 15:21:03 -0400
commit936553d666405bc783511979b17d78d51905b9cd (patch)
tree3eb3e0763a35907c946cbbd926d4428cb3a81258
parent4358e90a8f4fc7b3eaf6f42315b5d71b953391c6 (diff)
downloadphp-git-936553d666405bc783511979b17d78d51905b9cd.tar.gz
FD_ZERO file descriptors before calling curl_multi_fdset
As per curl documentation http://curl.haxx.se/libcurl/c/curl_multi_fdset.html we need to FD_ZERO file descriptors before calling the curl_multi_fdset function
-rw-r--r--ext/curl/streams.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/ext/curl/streams.c b/ext/curl/streams.c
index 4f97ee0572..e317285c31 100644
--- a/ext/curl/streams.c
+++ b/ext/curl/streams.c
@@ -162,6 +162,10 @@ static size_t php_curl_stream_read(php_stream *stream, char *buf, size_t count T
}
do {
+ FD_ZERO(&curlstream->readfds);
+ FD_ZERO(&curlstream->writefds);
+ FD_ZERO(&curlstream->excfds);
+
/* get the descriptors from curl */
curl_multi_fdset(curlstream->multi, &curlstream->readfds, &curlstream->writefds, &curlstream->excfds, &curlstream->maxfd);