mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-03-10 09:16:53 +00:00
HttpUtils.pm: websocket criteria changed (Forum #109910)
git-svn-id: https://svn.fhem.de/fhem/trunk@22119 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
4828c0ade0
commit
244e339831
@ -683,19 +683,19 @@ HttpUtils_DataComplete($)
|
|||||||
if(!defined($hl)) {
|
if(!defined($hl)) {
|
||||||
return 0 if($hash->{buf} !~ m/^(.*?)\r?\n\r?\n(.*)$/s);
|
return 0 if($hash->{buf} !~ m/^(.*?)\r?\n\r?\n(.*)$/s);
|
||||||
my ($hdr, $data) = ($1, $2);
|
my ($hdr, $data) = ($1, $2);
|
||||||
if($hdr =~ m/Transfer-Encoding:\s*chunked/si) {
|
if($hdr =~ m/Transfer-Encoding:\s*chunked/i) {
|
||||||
$hash->{httpheader} = $hdr;
|
$hash->{httpheader} = $hdr;
|
||||||
$hash->{httpdata} = "";
|
$hash->{httpdata} = "";
|
||||||
$hash->{buf} = $data;
|
$hash->{buf} = $data;
|
||||||
$hash->{httpdatalen} = -1;
|
$hash->{httpdatalen} = -1;
|
||||||
|
|
||||||
} elsif($hdr =~ m/Content-Length:\s*(\d+)/si) {
|
} elsif($hdr =~ m/Content-Length:\s*(\d+)/i) {
|
||||||
$hash->{httpdatalen} = $1;
|
$hash->{httpdatalen} = $1;
|
||||||
$hash->{httpheader} = $hdr;
|
$hash->{httpheader} = $hdr;
|
||||||
$hash->{httpdata} = $data;
|
$hash->{httpdata} = $data;
|
||||||
$hash->{buf} = "";
|
$hash->{buf} = "";
|
||||||
|
|
||||||
} elsif($hdr =~ m/Connection:\s*Upgrade/i) {
|
} elsif($hdr =~ m/Upgrade:\s*websocket/i) {
|
||||||
$hash->{httpdatalen} = 0;
|
$hash->{httpdatalen} = 0;
|
||||||
$hash->{httpheader} = $hdr;
|
$hash->{httpheader} = $hdr;
|
||||||
$hash->{httpdata} = $hash->{buf} = "";
|
$hash->{httpdata} = $hash->{buf} = "";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user