|
|
@ -49,7 +49,6 @@ class CurlDownloader
|
|
|
|
CURLM_OUT_OF_MEMORY => array('CURLM_OUT_OF_MEMORY', 'You are doomed.'),
|
|
|
|
CURLM_OUT_OF_MEMORY => array('CURLM_OUT_OF_MEMORY', 'You are doomed.'),
|
|
|
|
CURLM_INTERNAL_ERROR => array('CURLM_INTERNAL_ERROR', 'This can only be returned if libcurl bugs. Please report it to us!'),
|
|
|
|
CURLM_INTERNAL_ERROR => array('CURLM_INTERNAL_ERROR', 'This can only be returned if libcurl bugs. Please report it to us!'),
|
|
|
|
);
|
|
|
|
);
|
|
|
|
private $lastInfoUpdate = 0;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private static $options = array(
|
|
|
|
private static $options = array(
|
|
|
|
'http' => array(
|
|
|
|
'http' => array(
|
|
|
@ -241,7 +240,6 @@ class CurlDownloader
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
$this->checkCurlResult(curl_multi_add_handle($this->multiHandle, $curlHandle));
|
|
|
|
$this->checkCurlResult(curl_multi_add_handle($this->multiHandle, $curlHandle));
|
|
|
|
$this->lastInfoUpdate = 0;
|
|
|
|
|
|
|
|
// TODO progress
|
|
|
|
// TODO progress
|
|
|
|
|
|
|
|
|
|
|
|
return (int) $curlHandle;
|
|
|
|
return (int) $curlHandle;
|
|
|
@ -392,9 +390,6 @@ class CurlDownloader
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (microtime(true) - $this->lastInfoUpdate > 0.1) {
|
|
|
|
|
|
|
|
$this->lastInfoUpdate = microtime(true);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
foreach ($this->jobs as $i => $curlHandle) {
|
|
|
|
foreach ($this->jobs as $i => $curlHandle) {
|
|
|
|
if (!isset($this->jobs[$i])) {
|
|
|
|
if (!isset($this->jobs[$i])) {
|
|
|
|
continue;
|
|
|
|
continue;
|
|
|
@ -420,8 +415,6 @@ class CurlDownloader
|
|
|
|
// TODO progress
|
|
|
|
// TODO progress
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private function handleRedirect(array $job, Response $response, array $responseInfo)
|
|
|
|
private function handleRedirect(array $job, Response $response, array $responseInfo)
|
|
|
|