mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-27 21:58:52 +00:00
[ticket/10278] Also timeout when receiving data over a slow connection.
PHPBB3-10278
This commit is contained in:
parent
c0507c6a9e
commit
091119605a
1 changed files with 2 additions and 1 deletions
|
@ -3140,6 +3140,7 @@ function get_remote_file($host, $directory, $filename, &$errstr, &$errno, $port
|
|||
@fputs($fsock, "HOST: $host\r\n");
|
||||
@fputs($fsock, "Connection: close\r\n\r\n");
|
||||
|
||||
$timer_stop = time() + $timeout;
|
||||
stream_set_timeout($fsock, $timeout);
|
||||
|
||||
$file_info = '';
|
||||
|
@ -3167,7 +3168,7 @@ function get_remote_file($host, $directory, $filename, &$errstr, &$errno, $port
|
|||
|
||||
$stream_meta_data = stream_get_meta_data($fsock);
|
||||
|
||||
if (!empty($stream_meta_data['timed_out']))
|
||||
if (!empty($stream_meta_data['timed_out']) || time() >= $timer_stop)
|
||||
{
|
||||
$errstr = $user->lang['FSOCK_TIMEOUT'];
|
||||
return false;
|
||||
|
|
Loading…
Add table
Reference in a new issue