Configure a default timeout for HTTP connections at 60s

No requests we do externally should ever take more than 60 seconds. This
could probably be changed for downloading video or whatever for any cache
plugins that want to store data locally, but in general I think even 60s
is way longer than I expect any outgoing requests should take.

This affects everything using HTTPClient, our helper class, and thus all
hub pings, subscription requests, etc. etc.

The value, afaik, includes connect_timeout and if it takes 10 seconds to
establish a connection only 50 seconds is available to transfer data.
This commit is contained in:
Mikael Nordfeldth
2017-07-09 20:07:18 +02:00
parent 3395f6081c
commit f0480c34d7
2 changed files with 11 additions and 0 deletions

View File

@@ -393,6 +393,7 @@ $default =
'ssl_verify_host' => true, // HTTPRequest2 makes sure this is set to CURLOPT_SSL_VERIFYHOST==2 if using curl
'curl' => false, // Use CURL backend for HTTP fetches if available. (If not, PHP's socket streams will be used.)
'connect_timeout' => 5,
'timeout' => 60,
'proxy_host' => null,
'proxy_port' => null,
'proxy_user' => null,