aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2013-09-10 17:09:10 -0700
committerfriendica <info@friendica.com>2013-09-10 17:09:10 -0700
commit72f562c190630e69fa5a223855cd6f3a3bc66e49 (patch)
treedd9435e08e4077b449d01f428bfe9290ba4635c2
parent933c30d95d73c039257428081a38206cfcd3756d (diff)
downloadvolse-hubzilla-72f562c190630e69fa5a223855cd6f3a3bc66e49.tar.gz
volse-hubzilla-72f562c190630e69fa5a223855cd6f3a3bc66e49.tar.bz2
volse-hubzilla-72f562c190630e69fa5a223855cd6f3a3bc66e49.zip
z_fetch_url - include curl debug info in return array and log it (at logger_data level) on failure
This should probably be at a lower log level, but unsuccessful connections could happen a lot on a busy production site so we'll try to keep the log noise down unless somebody really needs to track this info.
-rw-r--r--include/network.php10
-rw-r--r--version.inc2
2 files changed, 11 insertions, 1 deletions
diff --git a/include/network.php b/include/network.php
index 8b9a8a6a6..00d931f19 100644
--- a/include/network.php
+++ b/include/network.php
@@ -312,8 +312,13 @@ function z_fetch_url($url, $binary = false, $redirects = 0, $opts = array()) {
$rc = intval($http_code);
$ret['return_code'] = $rc;
$ret['success'] = (($rc >= 200 && $rc <= 299) ? true : false);
+ if(! $ret['success']) {
+ $ret['debug'] = $curl_info;
+ logger('z_fetch_url: debug:' . print_r($curl_info,true), LOGGER_DATA);
+ }
$ret['body'] = substr($s,strlen($header));
$ret['header'] = $header;
+
@curl_close($ch);
return($ret);
}
@@ -407,6 +412,11 @@ function z_post_url($url,$params, $redirects = 0, $opts = array()) {
$rc = intval($http_code);
$ret['return_code'] = $rc;
$ret['success'] = (($rc >= 200 && $rc <= 299) ? true : false);
+ if(! $ret['success']) {
+ $ret['debug'] = $curl_info;
+ logger('z_fetch_url: debug:' . print_r($curl_info,true), LOGGER_DATA);
+ }
+
$ret['body'] = substr($s,strlen($header));
$ret['header'] = $header;
curl_close($ch);
diff --git a/version.inc b/version.inc
index 409e919d6..23045eee8 100644
--- a/version.inc
+++ b/version.inc
@@ -1 +1 @@
-2013-09-09.431
+2013-09-10.432