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

git-svn-id: svn://svn.code.sf.net/p/fhem/code/trunk@9115 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig
2015-08-23 09:40:37 +00:00
parent b24db67a4f
commit d31f8127db

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", "");
}