mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-04-07 19:04:20 +00:00
Timeout for connect too.
git-svn-id: https://svn.fhem.de/fhem/trunk@1979 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
f4e685a13f
commit
9075ce9e50
@ -45,6 +45,7 @@ urlEncode($) {
|
|||||||
##################
|
##################
|
||||||
# - if data (which is urlEncoded) is set, then a POST is performed, else a GET.
|
# - if data (which is urlEncoded) is set, then a POST is performed, else a GET.
|
||||||
# - noshutdown must be set for e.g the Fritz!Box
|
# - noshutdown must be set for e.g the Fritz!Box
|
||||||
|
# 4.0 is needed for some clients trying to reach fhem.de, 2.0 was not enough
|
||||||
sub
|
sub
|
||||||
CustomGetFileFromURL($$@)
|
CustomGetFileFromURL($$@)
|
||||||
{
|
{
|
||||||
@ -70,10 +71,13 @@ CustomGetFileFromURL($$@)
|
|||||||
my $conn;
|
my $conn;
|
||||||
if($protocol eq "https") {
|
if($protocol eq "https") {
|
||||||
eval "use IO::Socket::SSL";
|
eval "use IO::Socket::SSL";
|
||||||
Log 1, $@ if($@);
|
if($@) {
|
||||||
$conn = IO::Socket::SSL->new(PeerAddr => "$host:$port") if(!$@);
|
Log 1, $@;
|
||||||
|
} else {
|
||||||
|
$conn = IO::Socket::SSL->new(PeerAddr=>"$host:$port", Timeout=>$timeout);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
$conn = IO::Socket::INET->new(PeerAddr => "$host:$port");
|
$conn = IO::Socket::INET->new(PeerAddr=>"$host:$port", Timeout=>$timeout);
|
||||||
}
|
}
|
||||||
if(!$conn) {
|
if(!$conn) {
|
||||||
Log 1, "GetFileFromURL: Can't connect to $protocol://$host:$port\n";
|
Log 1, "GetFileFromURL: Can't connect to $protocol://$host:$port\n";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user