From 25e4ba1d7c4996dd3599f169186c45fe521f7db7 Mon Sep 17 00:00:00 2001 From: Andre Lorbach Date: Mon, 28 Mar 2011 12:47:02 +0200 Subject: [PATCH] Added php session_write_close to certain places to avoid hanging browser sessions --- src/chartgenerator.php | 3 +++ src/include/functions_common.php | 13 +++++++++++++ src/index.php | 4 ++++ src/reportgenerator.php | 3 +++ 4 files changed, 23 insertions(+) diff --git a/src/chartgenerator.php b/src/chartgenerator.php index 1b96a97..1ea2776 100644 --- a/src/chartgenerator.php +++ b/src/chartgenerator.php @@ -127,6 +127,9 @@ $content['TITLE'] = InitPageTitle(); // --- BEGIN Custom Code +// Do not BLOCK other Site Calls +WriteClosePHPSession(); + // Get data and print on the image! if ( !$content['error_occured'] ) { diff --git a/src/include/functions_common.php b/src/include/functions_common.php index fe2b52e..a97c13e 100644 --- a/src/include/functions_common.php +++ b/src/include/functions_common.php @@ -1513,6 +1513,19 @@ function StartPHPSession() } } +/* +* This Functions starts the main PHP Session if necessary +*/ +function WriteClosePHPSession() +{ + global $RUNMODE; + if ( $RUNMODE == RUNMODE_WEBSERVER ) + { + @session_write_close(); + } +} + + function PrintSecureUserCheck( $warningtext, $yesmsg, $nomsg ) { global $content, $page; diff --git a/src/index.php b/src/index.php index 0fb93c8..2d52f9e 100644 --- a/src/index.php +++ b/src/index.php @@ -197,6 +197,10 @@ else // --- BEGIN Custom Code + +// Do not BLOCK other Site Calls +WriteClosePHPSession(); + if ( isset($content['Sources'][$currentSourceID]) ) { // Obtain and get the Config Object diff --git a/src/reportgenerator.php b/src/reportgenerator.php index 8952387..c351635 100644 --- a/src/reportgenerator.php +++ b/src/reportgenerator.php @@ -92,6 +92,9 @@ $content['TITLE'] = InitPageTitle(); // --- BEGIN Custom Code +// Do not BLOCK other Site Calls +WriteClosePHPSession(); + // Get data and print on the image! if ( !$content['error_occured'] ) {