Revision: 7539
http://sourceforge.net/p/astlinux/code/7539
Author: abelbeck
Date: 2016-02-18 17:17:04 +0000 (Thu, 18 Feb 2016)
Log Message:
-----------
ddclient, use 'curl' for all network transactions, Thanks to David Kerr
Modified Paths:
--------------
branches/1.0/package/ddclient/ddclient-10-curl-ssl.patch
Modified: branches/1.0/package/ddclient/ddclient-10-curl-ssl.patch
===================================================================
--- branches/1.0/package/ddclient/ddclient-10-curl-ssl.patch 2016-02-17 18:52:14 UTC (rev 7538)
+++ branches/1.0/package/ddclient/ddclient-10-curl-ssl.patch 2016-02-18 17:17:04 UTC (rev 7539)
@@ -1,15 +1,15 @@
---- ddclient-3.8.3/ddclient.orig 2014-05-09 18:00:02.000000000 -0500
-+++ ddclient-3.8.3/ddclient 2014-05-09 18:00:51.000000000 -0500
+--- ddclient-3.8.3/ddclient.orig 2015-06-27 16:55:28.055154000 -0400
++++ ddclient-3.8.3/ddclient 2016-02-17 19:35:16.741410191 -0500
@@ -1916,7 +1916,7 @@
if ( $force_ssl || ($globals{'ssl'} and (caller(1))[3] ne 'main::get_ip') ) {
$use_ssl = 1;
$default_port = 443;
- load_ssl_support;
-+ #load_ssl_support;
++# load_ssl_support;
} else {
$use_ssl = 0;
$default_port = 80;
-@@ -1953,14 +1953,18 @@
+@@ -1953,58 +1953,32 @@
debug("skipped network connection");
verbose("SENDING:", "%s", $request);
} elsif ($use_ssl) {
@@ -21,7 +21,7 @@
- Timeout => opt('timeout'),
- );
- defined $sd or warning("cannot connect to $peer:$port socket: $@ " . IO::Socket::SSL::errstr());
-+ $0 = sprintf("%s - curl sending to %s port %s", $program, $peer, $port);
++ $0 = sprintf("%s - curl (SSL) sending to %s port %s", $program, $peer, $port);
+ my $timeout = opt('timeout');
+
+ $reply = <<`CURL_SSL`;
@@ -31,8 +31,64 @@
+CURL_SSL
+
+ if (! $reply) {
-+ warning("curl cannot connect to $peer:$port");
++ warning("curl (SSL) cannot connect to $peer:$port");
+ }
} else {
- $sd = IO::Socket::INET->new(
- PeerAddr => $peer,
+- $sd = IO::Socket::INET->new(
+- PeerAddr => $peer,
+- PeerPort => $port,
+- Proto => 'tcp',
+- MultiHomed => 1,
+- Timeout => opt('timeout'),
+- );
+- defined $sd or warning("cannot connect to $peer:$port socket: $@");
+- }
++ $0 = sprintf("%s - curl (non-SSL) sending to %s port %s", $program, $peer, $port);
++ my $timeout = opt('timeout');
+
+- if (defined $sd) {
+- ## send the request to the http server
+- verbose("CONNECTED: ", $use_ssl ? 'using SSL' : 'using HTTP');
+- verbose("SENDING:", "%s", $request);
+-
+- $0 = sprintf("%s - sending to %s port %s", $program, $peer, $port);
+- my $result = syswrite $sd, $rq;
+- if ($result != length($rq)) {
+- warning("cannot send to $peer:$port ($!).");
+- } else {
+- $0 = sprintf("%s - reading from %s port %s", $program, $peer, $port);
+- eval {
+- local $SIG{'ALRM'} = sub { die "timeout";};
+- alarm(opt('timeout')) if opt('timeout') > 0;
+- while ($_ = <$sd>) {
+- $0 = sprintf("%s - read from %s port %s", $program, $peer, $port);
+- verbose("RECEIVE:", "%s", define($_, "<undefined>"));
+- $reply .= $_ if defined $_;
+- }
+- if (opt('timeout') > 0) {
+- alarm(0);
+- }
+- };
+- close($sd);
+-
+- if ($@ and $@ =~ /timeout/) {
+- warning("TIMEOUT: %s after %s seconds", $to, opt('timeout'));
+- $reply = '';
+- }
+- $reply = '' if !defined $reply;
+- }
+- }
+- $0 = sprintf("%s - closed %s port %s", $program, $peer, $port);
++ $reply = <<`CURL`;
++/usr/bin/curl -si0 --user '${login}:${password}' --user-agent '${program}/${version}' \\
++ --connect-timeout $timeout --max-time $timeout \\
++ --url 'http://${server}/${url}' 2>/dev/null
++CURL
++
++ if (! $reply) {
++ warning("curl (non-SSL) cannot connect to $peer:$port");
++ }
++ }
+
+ ## during testing simulate reading the URL
+ if (opt('test')) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|