diff options
author | Andreas Fischer <bantu@phpbb.com> | 2011-10-13 18:03:02 +0200 |
---|---|---|
committer | Andreas Fischer <bantu@phpbb.com> | 2011-10-13 18:03:02 +0200 |
commit | 091119605abe794aa508c76b7e5199517fc256e3 (patch) | |
tree | 70c24f6659ef1f08a5fcf74259f29b671a089585 /phpBB/includes | |
parent | c0507c6a9e26ba250596530f501bf6843250ed36 (diff) | |
download | forums-091119605abe794aa508c76b7e5199517fc256e3.tar forums-091119605abe794aa508c76b7e5199517fc256e3.tar.gz forums-091119605abe794aa508c76b7e5199517fc256e3.tar.bz2 forums-091119605abe794aa508c76b7e5199517fc256e3.tar.xz forums-091119605abe794aa508c76b7e5199517fc256e3.zip |
[ticket/10278] Also timeout when receiving data over a slow connection.
PHPBB3-10278
Diffstat (limited to 'phpBB/includes')
-rw-r--r-- | phpBB/includes/functions_admin.php | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/phpBB/includes/functions_admin.php b/phpBB/includes/functions_admin.php index bcd477d855..513b7a68b2 100644 --- a/phpBB/includes/functions_admin.php +++ b/phpBB/includes/functions_admin.php @@ -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; |