Set curl connect timeout to 5s

This commit is contained in:
Steffen Lange 2021-04-14 12:20:01 +02:00
parent b2ae61dffd
commit 77ac2958b8

View file

@ -98,6 +98,7 @@ abstract class PatchBase {
curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (compatible; Patchbot/1.0; +http://www.patchbot.de/)'); curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (compatible; Patchbot/1.0; +http://www.patchbot.de/)');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5);
foreach ($opts as $opt) foreach ($opts as $opt)
curl_setopt($ch, $opt[0], $opt[1]); curl_setopt($ch, $opt[0], $opt[1]);
if ($opt = HostOption::get(parse_url($url, PHP_URL_HOST))) if ($opt = HostOption::get(parse_url($url, PHP_URL_HOST)))