From 8c6a235d9d0fb85ce4409a3ed3d45972df2353f5 Mon Sep 17 00:00:00 2001 From: rudolfkoenig Date: Mon, 17 Jan 2022 20:59:02 +0000 Subject: [PATCH] HttpUtils.pm: Multi-Chunked patch by justme1968 (Forum #122066) git-svn-id: https://svn.fhem.de/fhem/trunk@25487 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/FHEM/HttpUtils.pm | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/fhem/FHEM/HttpUtils.pm b/fhem/FHEM/HttpUtils.pm index e05da7269..b79582404 100644 --- a/fhem/FHEM/HttpUtils.pm +++ b/fhem/FHEM/HttpUtils.pm @@ -734,7 +734,13 @@ HttpUtils_DataComplete($) my $ret = substr($r, 0, $l); if( $hash->{EventSource} ) { - $hash->{callback}($hash, undef, $ret); + $hash->{httpdata} .= $ret; + if( $ret !~ /\n$/ ) { + # data is incomplete + } else { + $hash->{callback}($hash, undef, $hash->{httpdata}); + $hash->{httpdata} = ''; + } } else { $hash->{httpdata} .= $ret;