From 0c424323a3b11c2652b2ee4e362724f516d84706 Mon Sep 17 00:00:00 2001
From: rudolfkoenig <>
Date: Sun, 10 May 2015 07:47:07 +0000
Subject: [PATCH] 01_FHEMWEB.pm: jump to the end for large text-logs (Forum
#37042)
git-svn-id: https://svn.fhem.de/fhem/trunk@8556 2b470e98-0d58-463d-a4d8-8e2adae1ed80
---
fhem/FHEM/01_FHEMWEB.pm | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/fhem/FHEM/01_FHEMWEB.pm b/fhem/FHEM/01_FHEMWEB.pm
index 9c47bcf69..7d9c975cf 100755
--- a/fhem/FHEM/01_FHEMWEB.pm
+++ b/fhem/FHEM/01_FHEMWEB.pm
@@ -1556,6 +1556,7 @@ FW_returnFileAsStream($$$$$)
return 0;
}
binmode(FH) if($type !~ m/text/); # necessary for Windows
+ my $sz = -s $path;
$etag = defined($etag) ? "ETag: \"$etag\"\r\n" : "";
my $expires = $cacheable ? ("Expires: ".gmtime(time()+900)." GMT\r\n"): "";
@@ -1569,6 +1570,9 @@ FW_returnFileAsStream($$$$$)
my $d = Compress::Zlib::deflateInit(-WindowBits=>31) if($compr);
FW_outputChunk($FW_chash, $FW_RET, $d);
+ FW_outputChunk($FW_chash,
+ "jump to the end
", $d)
+ if($doEsc && $sz > 2048);
my $buf;
while(sysread(FH, $buf, 2048)) {
if($doEsc) { # FileLog special
@@ -1578,6 +1582,8 @@ FW_returnFileAsStream($$$$$)
FW_outputChunk($FW_chash, $buf, $d);
}
close(FH);
+ FW_outputChunk($FW_chash, "", $d)
+ if($doEsc && $sz > 2048);
FW_outputChunk($FW_chash, $suffix, $d);
if($compr) {