From 3e135400fa6e420d8c472d187edc7103310cd701 Mon Sep 17 00:00:00 2001 From: rudolfkoenig <> Date: Sun, 14 Aug 2011 10:06:18 +0000 Subject: [PATCH] Missing Zlib with multiple WEB instances crashes fhem git-svn-id: https://svn.fhem.de/fhem/trunk@981 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/webfrontend/pgm2/01_FHEMWEB.pm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/fhem/webfrontend/pgm2/01_FHEMWEB.pm b/fhem/webfrontend/pgm2/01_FHEMWEB.pm index 79008d377..3e6d6d02b 100755 --- a/fhem/webfrontend/pgm2/01_FHEMWEB.pm +++ b/fhem/webfrontend/pgm2/01_FHEMWEB.pm @@ -41,6 +41,7 @@ use vars qw($FW_ss); # is smallscreen, needed by 97_GROUP/95_VIEW use vars qw($FW_tp); # is touchpad (iPad / etc) use vars qw(%FW_types);# device types, for sorting, for 97_GROUP/95_VIEW my $zlib_loaded; +my $try_zlib = 1; ######################### @@ -208,10 +209,11 @@ FW_Read($) my $ll = GetLogLevel($FW_wname,4); my $c = $hash->{CD}; - if(!$zlib_loaded && AttrVal($FW_wname, "fwcompress", 1)) { + if(!$zlib_loaded && $try_zlib && AttrVal($FW_wname, "fwcompress", 1)) { $zlib_loaded = 1; eval { require Compress::Zlib; }; if($@) { + $try_zlib = 0; Log 1, $@; Log 1, "$FW_wname: Can't load Compress::Zlib, deactivating compression"; $attr{$FW_wname}{fwcompress} = 0; @@ -280,8 +282,8 @@ FW_Read($) $FW_RETTYPE=~m/svg/i || $FW_RETTYPE=~m/script/i) && (int(@enc) == 1 && $enc[0] =~ m/gzip/) && + $try_zlib && AttrVal($FW_wname, "fwcompress", 1)) { - $FW_RET = Compress::Zlib::memGzip($FW_RET); $compressed = "Content-Encoding: gzip\r\n"; }