From 64ea5a6abe32f05716e997f1c8341727b13c7ebc Mon Sep 17 00:00:00 2001 From: rudolfkoenig <> Date: Tue, 6 Mar 2018 20:44:37 +0000 Subject: [PATCH] HttpUtils.pm: incrementalTimeout Patch from justme1968 (Forum #85307) git-svn-id: https://svn.fhem.de/fhem/trunk@16343 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/FHEM/HttpUtils.pm | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/fhem/FHEM/HttpUtils.pm b/fhem/FHEM/HttpUtils.pm index fe8f4bc70..7b8615d4d 100644 --- a/fhem/FHEM/HttpUtils.pm +++ b/fhem/FHEM/HttpUtils.pm @@ -574,6 +574,11 @@ HttpUtils_Connect2($) RemoveInternalTimer(\%timerHash); my ($err, $ret, $redirect) = HttpUtils_ParseAnswer($hash); $hash->{callback}($hash, $err, $ret) if(!$redirect); + + } elsif($hash->{incrementalTimeout}) { # Forum #85307 + RemoveInternalTimer(\%timerHash); + InternalTimer(gettimeofday()+$hash->{timeout}, + "HttpUtils_Err", \%timerHash); } }; @@ -842,7 +847,7 @@ HttpUtils_ParseAnswer($) # digest(0),hideurl(0),timeout(4),data(""),loglevel(4),header("" or HASH), # noshutdown(1),shutdown(0),httpversion("1.0"),ignoreredirects(0) # method($data?"POST":"GET"),keepalive(0),sslargs({}),user(),pwd() -# compress(1) +# compress(1), incrementalTimeout(0) # Example: # { HttpUtils_NonblockingGet({ url=>"http://fhem.de/MAINTAINER.txt", # callback=>sub($$$){ Log 1,"ERR:$_[1] DATA:".length($_[2]) } }) }