HttpUtils.pm: close keepalive if the server does not support it (Forum #40272)

git-svn-id: https://svn.fhem.de/fhem/trunk@9115 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig
2015-08-23 09:40:37 +00:00
parent 0282ec35fd
commit b678a60d2d

View File

@@ -350,6 +350,9 @@ HttpUtils_ParseAnswer($$)
my @header0= split(" ", shift @header);
my $code= $header0[1];
# Close if server doesn't support keepalive
HttpUtils_Close($hash) if($hash->{keepalive} and $hash->{httpheader} =~ m/^Connection:\s*close\s*$/mi);
if(!defined($code) || $code eq "") {
return ("$hash->{displayurl}: empty answer received", "");
}