Skip to content

Commit

Permalink
[~]: reduce usleep time for "curl_multi_select" === -1
Browse files Browse the repository at this point in the history
  • Loading branch information
voku committed Dec 19, 2019
1 parent 4822fd4 commit c78b921
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ root = true

[*]
indent_style = space
indent_size = 2
indent_size = 4
end_of_line = lf
charset = utf-8
#trim_trailing_whitespace = true
Expand Down
5 changes: 3 additions & 2 deletions src/Httpful/Curl/MultiCurl.php
Original file line number Diff line number Diff line change
Expand Up @@ -224,11 +224,12 @@ public function start()
}
}

$active = null;
do {
// Wait for activity on any curl_multi connection when curl_multi_select (libcurl) fails to correctly block.
// https://bugs.php.net/bug.php?id=63411
if (\curl_multi_select($this->multiCurl) === -1) {
\usleep(100000);
if ($active && \curl_multi_select($this->multiCurl) === -1) {
\usleep(250);
}

\curl_multi_exec($this->multiCurl, $active);
Expand Down

0 comments on commit c78b921

Please sign in to comment.