Commit fda43721 authored by Chris Graham's avatar Chris Graham

Fix error if download stream fails immediately after checking it has not

parent e80e9cce
......@@ -1666,7 +1666,7 @@ function _http_download_file($url, $byte_limit = null, $trigger_error = true, $n
$_frh = array($mysock);
$_fwh = null;
while (($chunked) || (!@feof($mysock))) { // @'d because socket might have died. If so fread will will return false and hence we'll break
if ((function_exists('stream_select')) && (count($_frh) > 0) && (!stream_select($_frh, $_fwh, $_fwh, intval($timeout), fmod($timeout, 1.0) / 1000000.0))) {
if ((function_exists('stream_select')) && (count($_frh) > 0) && (!@stream_select($_frh, $_fwh, $_fwh, intval($timeout), fmod($timeout, 1.0) / 1000000.0))) {
if ((!$chunked) || ($buffer_unprocessed == '')) {
if ($trigger_error) {
warn_exit(do_lang_tempcode('HTTP_DOWNLOAD_CONNECTION_STALLED', escape_html($url)));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment