Skip to content

Commit 936553d

Browse files
committed
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
1 parent 4358e90 commit 936553d

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

ext/curl/streams.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,10 @@ static size_t php_curl_stream_read(php_stream *stream, char *buf, size_t count T
162162
}
163163

164164
do {
165+
FD_ZERO(&curlstream->readfds);
166+
FD_ZERO(&curlstream->writefds);
167+
FD_ZERO(&curlstream->excfds);
168+
165169
/* get the descriptors from curl */
166170
curl_multi_fdset(curlstream->multi, &curlstream->readfds, &curlstream->writefds, &curlstream->excfds, &curlstream->maxfd);
167171

0 commit comments

Comments
 (0)