@@ -55,8 +55,9 @@ discard block |
||
| 55 | 55 | $con = @stream_socket_accept($socket, -1); |
| 56 | 56 | if (!$con) { |
| 57 | 57 | $err = error_get_last(); // どーなんだこれ strerror(EINTR) |
| 58 | - if (strpos($err["message"], "Interrupted system call") !== false) |
|
| 59 | - continue; |
|
| 58 | + if (strpos($err["message"], "Interrupted system call") !== false) { |
|
| 59 | + continue; |
|
| 60 | + } |
|
| 60 | 61 | fwrite(STDERR, "[Server] " . $err["message"] . "\n"); |
| 61 | 62 | exit(1); |
| 62 | 63 | } |
@@ -91,7 +92,9 @@ discard block |
||
| 91 | 92 | parse_str(isset($parsed['query']) ? $parsed['query'] : '', $q); |
| 92 | 93 | foreach ($endpoints as $endpoint => $action) { |
| 93 | 94 | if ($parsed['path'] === $endpoint || $endpoint === '') { |
| 94 | - if ($endpoint === '') $endpoint = '[Undefined]'; |
|
| 95 | + if ($endpoint === '') { |
|
| 96 | + $endpoint = '[Undefined]'; |
|
| 97 | + } |
|
| 95 | 98 | fwrite(STDERR, "Request: $parts[1]\n"); |
| 96 | 99 | $action($con, $q); |
| 97 | 100 | exit(0); |
@@ -323,8 +323,10 @@ |
||
| 323 | 323 | // NOTE: DO NOT call curl_multi_remove_handle |
| 324 | 324 | // or curl_multi_add_handle while looping curl_multi_info_read! |
| 325 | 325 | $entries = array(); |
| 326 | - do if ($entry = curl_multi_info_read($this->mh, $remains)) { |
|
| 326 | + do { |
|
| 327 | + if ($entry = curl_multi_info_read($this->mh, $remains)) { |
|
| 327 | 328 | $entries[] = $entry; |
| 329 | + } |
|
| 328 | 330 | } while ($remains); |
| 329 | 331 | // Remove done and consume queue. |
| 330 | 332 | foreach ($entries as $entry) { |