From dbd44f64dd7030a2013b6b7b7e7f561e8cee9121 Mon Sep 17 00:00:00 2001 From: logmanoriginal Date: Wed, 24 Oct 2018 16:10:29 +0200 Subject: [PATCH] [contents] Add debug messages for 'getContents' Adds additional messages to the error log when fetching contents. The data is helpful in finding issues with receiving contents from servers. References: #879, #882, #884 --- lib/contents.php | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/lib/contents.php b/lib/contents.php index 2acc7fc5..1d504f55 100644 --- a/lib/contents.php +++ b/lib/contents.php @@ -1,24 +1,37 @@ $value) { curl_setopt($ch, $key, $value); } + } if(defined('PROXY_URL') && !defined('NOPROXY')) { + + debugMessage('Setting proxy url: ' . PROXY_URL); curl_setopt($ch, CURLOPT_PROXY, PROXY_URL); + } // We always want the response header as part of the data! @@ -34,6 +47,9 @@ function getContents($url, $header = array(), $opts = array()){ $headerSize = curl_getinfo($ch, CURLINFO_HEADER_SIZE); $errorCode = curl_getinfo($ch, CURLINFO_HTTP_CODE); $header = substr($data, 0, $headerSize); + + debugMessage('Response header: ' . $header); + $headers = parseResponseHeader($header); $finalHeader = end($headers);