Index: openacs-4/packages/cookie-consent/tcl/cookie-consent-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cookie-consent/tcl/cookie-consent-procs.tcl,v diff -u -N -r1.7 -r1.8 --- openacs-4/packages/cookie-consent/tcl/cookie-consent-procs.tcl 30 Apr 2018 09:01:47 -0000 1.7 +++ openacs-4/packages/cookie-consent/tcl/cookie-consent-procs.tcl 11 Jun 2018 16:59:06 -0000 1.8 @@ -217,13 +217,19 @@ Initialize an cookie-consent widget. } { - if {![ns_conn isconnected]} { + if {[catch {ns_conn content}]} { # - # If called in error cases, do nothing + # If the connection is already closed, do nothing. # + # "ns_conn content" will raise an exception, when the + # connection is already closed. This is not obivous + # without deeper knowledge. Therefore, NaviServer needs + # probably a "ns_conn closed" flag the check for such + # situations in a more self-expanatory way. + # return } - + if {$subsite_id eq ""} { set subsite_id [get_relevant_subsite] } @@ -239,7 +245,7 @@ # reconsidered. # set cookie_set [ad_get_cookie "cookieconsent_status-$subsite_id" ""] - + if {$enabled_p && $cookie_set eq ""} { # # Create an instance of the consent widget class from all configuration options @@ -398,7 +404,7 @@ # Do we have gzip installed? # set gzip [::util::which gzip] - + # # So far, everything is fine, download the # files. "download_file" will raise an exception, when the @@ -409,7 +415,7 @@ [dict get $version_info jsFiles]] { set fn [download_file $download_prefix/$version/$file] file rename -force -- $fn $resource_prefix/$version/$file - + # # When gzip is available, produce a static compressed file as well #