From b88e05cb70631a5792356158f020765ba84e9e44 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ermal=20Lu=C3=A7i?= Date: Sun, 20 Jul 2008 19:06:03 +0000 Subject: * Make some sanity checks before using CURLOPT_SETINTERFACE * close the curl instance after using it. With CURLOPT_SETINTERFACE a new instance is needed to correcly use it. --- etc/inc/dyndns.class | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'etc') diff --git a/etc/inc/dyndns.class b/etc/inc/dyndns.class index fc06303..75bc749 100644 --- a/etc/inc/dyndns.class +++ b/etc/inc/dyndns.class @@ -853,8 +853,10 @@ $ip_ch = curl_init('http://checkip.dyndns.org'); curl_setopt($ip_ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ip_ch, CURLOPT_SSL_VERIFYPEER, FALSE); - curl_setopt($ip_ch, CURLOPT_SETINTERFACE, $this->_dnsIP); + if ($this->_dnsIP <> "" || $this->_dnsIP <> "0.0.0.0") + curl_setopt($ip_ch, CURLOPT_SETINTERFACE, $this->_dnsIP); $ip_result_page = curl_exec($ip_ch); + curl_close($ip_ch); $ip_result_decoded = urldecode($ip_result_page); preg_match('=Current IP Address: (.*)=siU', $ip_result_decoded, $matches); $ip_address = trim($matches[1]); -- cgit v1.1