From 0c7b834e31d6160d434e806fcc468b2f0401b36d Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Mon, 7 Nov 2005 21:23:00 +0000 Subject: Log CURL errors correctly --- etc/inc/dyndns.class | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'etc') diff --git a/etc/inc/dyndns.class b/etc/inc/dyndns.class index 31b4836..1c881cc 100644 --- a/etc/inc/dyndns.class +++ b/etc/inc/dyndns.class @@ -126,7 +126,7 @@ curl_setopt($ch, CURLOPT_USERPWD, $this->_dnsUser.':'.$this->_dnsPass); curl_setopt($ch, CURLOPT_URL, 'https://members.dyndns.org/nic/update?hostname='.$this->_dnsHost.'&myip='.$this->_dnsIP.'&wildcard='.$this->_dnsWildcard.'&mx='.$this->_dnsMX.'&backmx=NO'); $data = curl_exec($ch); - if (@curl_error($ch)) log_error($error = curl_error($ch)); + if (@curl_error($ch)) log_error("Curl errror occured: " . curl_error($ch)); curl_close($ch); $this->_checkStatus($data); break; @@ -136,7 +136,7 @@ curl_setopt($ch, CURLOPT_USERPWD, $this->_dnsUser.':'.$this->_dnsPass); curl_setopt($ch, CURLOPT_URL, 'https://members.dyndns.org/nic/update?system=statdns&hostname='.$this->_dnsHost.'&myip='.$this->_dnsIP.'&wildcard='.$this->_dnsWildcard.'&mx='.$this->_dnsMX.'&backmx=NO'); $data = curl_exec($ch); - if (@curl_error($ch)) log_error($error = curl_error($ch)); + if (@curl_error($ch)) log_error("Curl errror occured: " . curl_error($ch)); curl_close($ch); $this->_checkStatus($data); break; @@ -146,7 +146,7 @@ curl_setopt($ch, CURLOPT_USERPWD, $this->_dnsUser.':'.$this->_dnsPass); curl_setopt($ch, CURLOPT_URL, 'https://members.dyndns.org/nic/update?system=custom&hostname='.$this->_dnsHost.'&myip='.$this->_dnsIP.'&wildcard='.$this->_dnsWildcard.'&mx='.$this->_dnsMX.'&backmx=NO'); $data = curl_exec($ch); - if (@curl_error($ch)) log_error($error = curl_error($ch)); + if (@curl_error($ch)) log_error("Curl errror occured: " . curl_error($ch)); curl_close($ch); $this->_checkStatus($data); break; @@ -171,7 +171,7 @@ curl_setopt($ch, CURLOPT_USERPWD, $this->_dnsUser.':'.$this->_dnsPass); curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data); $data = curl_exec($ch); - if (@curl_error($ch)) log_error($error = curl_error($ch)); + if (@curl_error($ch)) log_error("Curl errror occured: " . curl_error($ch)); curl_close($ch); $this->_checkStatus($data); break; @@ -180,7 +180,7 @@ curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); curl_setopt($ch, CURLOPT_URL, 'http://dynupdate.no-ip.com/dns?username='.$this->_dnsUser.'&password='.$this->_dnsPass.'&hostname='.$this->_dnsHost.'&ip='.$this->_dnsIP); $data = curl_exec($ch); - if (@curl_error($ch)) log_error($error = curl_error($ch)); + if (@curl_error($ch)) log_error("Curl errror occured: " . curl_error($ch)); curl_close($ch); $this->_checkStatus($data); break; @@ -190,7 +190,7 @@ curl_setopt($ch, CURLOPT_USERPWD, $this->_dnsUser.':'.$this->_dnsPass); curl_setopt($ch, CURLOPT_URL, 'http://members.easydns.com/dyn/dyndns.php?hostname='.$this->_dnsHost.'&myip='.$this->_dnsIP.'&wildcard='.$this->_dnsWildcard.'&mx='.$this->_dnsMX.'&backmx='.$this->_dnsBackMX); $data = curl_exec($ch); - if (@curl_error($ch)) log_error($error = curl_error($ch)); + if (@curl_error($ch)) log_error("Curl errror occured: " . curl_error($ch)); curl_close($ch); $this->_checkStatus($data); break; @@ -200,7 +200,7 @@ curl_setopt($ch, CURLOPT_USERPWD, $this->_dnsUser.':'.$this->_dnsPass); curl_setopt($ch, CURLOPT_URL, 'http://dup.hn.org/vanity/update?ver=1&IP='.$this->_dnsIP); $data = curl_exec($ch); - if (@curl_error($ch)) log_error($error = curl_error($ch)); + if (@curl_error($ch)) log_error("Curl errror occured: " . curl_error($ch)); curl_close($ch); $this->_checkStatus($data); break; @@ -209,7 +209,7 @@ curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); curl_setopt($ch, CURLOPT_URL, 'https://dynamic.zoneedit.com/auth/dynamic.html?host='.$this->_dnsHost.'&dnsto='.$this->_dnsIP); $data = curl_exec($ch); - if (@curl_error($ch)) log_error($error = curl_error($ch)); + if (@curl_error($ch)) log_error("Curl errror occured: " . curl_error($ch)); curl_close($ch); $this->_checkStatus($data); break; @@ -217,7 +217,7 @@ $needsIP = FALSE; curl_setopt($ch, CURLOPT_URL, 'http://www.dyns.cx/postscript011.php?username='.$this->_dnsUser.'&password='.$this->_dnsPass.'&host='.$this->_dnsHost); $data = curl_exec($ch); - if (@curl_error($ch)) log_error($error = curl_error($ch)); + if (@curl_error($ch)) log_error("Curl errror occured: " . curl_error($ch)); curl_close($ch); $this->_checkStatus($data); break; @@ -562,4 +562,4 @@ } -?> +?> \ No newline at end of file -- cgit v1.1