diff --git a/fhem/FHEM/01_FHEMWEB.pm b/fhem/FHEM/01_FHEMWEB.pm index bb5353310..5fff016da 100755 --- a/fhem/FHEM/01_FHEMWEB.pm +++ b/fhem/FHEM/01_FHEMWEB.pm @@ -140,6 +140,7 @@ FHEMWEB_Initialize($) allowfrom basicAuth basicAuthMsg + closeConn:1,0 column defaultRoom editConfig:1,0 @@ -318,7 +319,6 @@ FW_Read($$) } } - if(!$hash->{HDR}) { return if($hash->{BUF} !~ m/^(.*?)(\n\n|\r\n\r\n)(.*)$/s); $hash->{HDR} = $1; @@ -402,7 +402,7 @@ FW_Read($$) $hash->{LASTACCESS} = $now; $arg = "" if(!defined($arg)); - Log3 $FW_wname, 4, "HTTP $name GET $arg"; + Log3 $FW_wname, 4, "$name $method $arg; BUFLEN:".length($hash->{BUF}); $FW_ME = "/" . AttrVal($FW_wname, "webname", "fhem"); my $pf = AttrVal($FW_wname, "plotfork", undef); if($pf) { # 0 disables @@ -457,7 +457,7 @@ FW_Read($$) my $expires = ($cacheable? ("Expires: ".FmtDateTimeRFC1123($now+900)."\r\n") : ""); Log3 $FW_wname, 4, - "$$:$name: $arg / RL:$length / $FW_RETTYPE / $compressed / $expires"; + "name: $arg / RL:$length / $FW_RETTYPE / $compressed / $expires"; if( ! addToWritebuffer($hash, "HTTP/1.1 200 OK\r\n" . "Content-Length: $length\r\n" . @@ -476,6 +476,14 @@ sub FW_closeConn($) { my ($hash) = @_; + if(!$hash->{inform} && !$hash->{BUF}) { # Forum #41125 + my $cc = AttrVal($hash->{SNAME}, "closeConn", + $FW_userAgent=~m/(iPhone|iPad|iPod)/); + if(!$FW_httpheader{Connection} || $cc) { + TcpServer_Close($hash); + delete($defs{$hash->{NAME}}); + } + } POSIX::exit(0) if($hash->{isChild}); FW_Read($hash, 1) if($hash->{BUF}); } @@ -1578,6 +1586,7 @@ FW_returnFileAsStream($$$$$) my $rsp = "Date: ".FmtDateTimeRFC1123($now)."\r\n". "ETag: $etag\r\n". "Expires: ".FmtDateTimeRFC1123($now+900)."\r\n"; + Log3 $FW_wname, 4, "$FW_chash->{NAME} => 304 Not Modified"; TcpServer_WriteBlocking($FW_chash,"HTTP/1.1 304 Not Modified\r\n". $rsp . $FW_headercors . "\r\n"); return -1; @@ -3381,6 +3390,13 @@ FW_widgetOverride($$) attribute. + +
  • closeConn
    + If set, a TCP Connection will only serve one HTTP request. Seems to + solve problems on iOS9 for WebApp startup. +

  • + +
  • CssFiles
    Space separated list of .css files to be included. The filenames @@ -4088,6 +4104,12 @@ FW_widgetOverride($$) %20 zu schreiben.

  • + +
  • closeConn
    + Falls gesetzt, wird pro TCP Verbindung nur ein HTTP Request + durchgeführt. Für iOS9 WebApp startups scheint es zu helfen. +

  • +
  • CssFiles
    Leerzeichen getrennte Liste von .css Dateien, die geladen werden. diff --git a/fhem/fhem.cfg.demo b/fhem/fhem.cfg.demo index f053b3770..72a53441c 100644 --- a/fhem/fhem.cfg.demo +++ b/fhem/fhem.cfg.demo @@ -9,6 +9,7 @@ attr global sendStatistics never attr global statefile ./demolog/fhem.save attr global updateInBackground 1 attr global verbose 3 +attr global mseclog define telnetPort telnet 7072 global attr telnetPort room System @@ -27,7 +28,6 @@ attr WEBphone iconPath openautomation:fhemSVG:default attr WEBphone room System attr WEBphone sortRooms Light Cinema Residents Sensors System attr WEBphone stylesheetPrefix smallscreen -attr WEBphone plotEmbed 0 define WEBtablet FHEMWEB 8085 global attr WEBtablet hiddenroom DashboardRoom @@ -35,7 +35,6 @@ attr WEBtablet iconPath openautomation:fhemSVG:default attr WEBtablet room System attr WEBtablet sortRooms Light Cinema Residents Sensors System attr WEBtablet stylesheetPrefix ios7touchpad -attr WEBtablet plotEmbed 0 # Fake FileLog entry, to access the fhem log from FHEMWEB define Logfile FileLog ./log/fhem-%Y-%m.log fakelog