X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FNetwork%2FHTTPRequest.php;h=74cf9cd0554d01a62beb0a1486b391bb734f4f69;hb=befc2af5043a3afde251721c0d27df695db1bb7e;hp=a0d940414e0a7c331be5cd63d08c7f0fa5c5ee4c;hpb=4719af67245293c94bd4c4cb75e242841ed32ab6;p=friendica.git diff --git a/src/Network/HTTPRequest.php b/src/Network/HTTPRequest.php index a0d940414e..74cf9cd055 100644 --- a/src/Network/HTTPRequest.php +++ b/src/Network/HTTPRequest.php @@ -1,6 +1,6 @@ 1000) { $this->logger->debug('URL is longer than 1000 characters.', ['url' => $url, 'callstack' => System::callstack(20)]); + $this->profiler->saveTimestamp($stamp1, 'network'); return CurlResult::createErrorCurl(substr($url, 0, 200)); } @@ -94,12 +95,14 @@ class HTTPRequest implements IHTTPRequest if (Network::isUrlBlocked($url)) { $this->logger->info('Domain is blocked.', ['url' => $url]); + $this->profiler->saveTimestamp($stamp1, 'network'); return CurlResult::createErrorCurl($url); } $ch = @curl_init($url); if (($redirects > 8) || (!$ch)) { + $this->profiler->saveTimestamp($stamp1, 'network'); return CurlResult::createErrorCurl($url); } @@ -201,6 +204,7 @@ class HTTPRequest implements IHTTPRequest $redirects++; $this->logger->notice('Curl redirect.', ['url' => $url, 'to' => $curlResponse->getRedirectUrl()]); @curl_close($ch); + $this->profiler->saveTimestamp($stamp1, 'network'); return $this->get($curlResponse->getRedirectUrl(), $opts, $redirects); } @@ -224,12 +228,14 @@ class HTTPRequest implements IHTTPRequest if (Network::isUrlBlocked($url)) { $this->logger->info('Domain is blocked.' . ['url' => $url]); + $this->profiler->saveTimestamp($stamp1, 'network'); return CurlResult::createErrorCurl($url); } $ch = curl_init($url); if (($redirects > 8) || (!$ch)) { + $this->profiler->saveTimestamp($stamp1, 'network'); return CurlResult::createErrorCurl($url); } @@ -289,6 +295,7 @@ class HTTPRequest implements IHTTPRequest $redirects++; $this->logger->info('Post redirect.', ['url' => $url, 'to' => $curlResponse->getRedirectUrl()]); curl_close($ch); + $this->profiler->saveTimestamp($stamp1, 'network'); return $this->post($curlResponse->getRedirectUrl(), $params, $headers, $redirects, $timeout); }