session_write_close added #364
I just learned that PHP does lock it's session objects. This is realy bad if you have multiple images in a page as each one will call fetch.php which locks the session, so everything can only be loaded sequentially. The fix for this is to close the session after using it which is after doing the auth and the breadcrumbs. I added the needed calls everywhere. darcs-hash:20050608213514-9977f-f2dfc467ebbd06406e10e33a386fa1db6cb32dba.gz
This commit is contained in:
parent
bdbc16bf99
commit
8746e7272c
8
doku.php
8
doku.php
|
@ -18,7 +18,6 @@
|
|||
|
||||
//import variables
|
||||
$QUERY = trim($_REQUEST['id']);
|
||||
# $ID = cleanID($_REQUEST['id']);
|
||||
$ID = getID();
|
||||
$REV = $_REQUEST['rev'];
|
||||
$ACT = $_REQUEST['do'];
|
||||
|
@ -54,6 +53,13 @@
|
|||
//make infos about the selected page available
|
||||
$INFO = pageinfo();
|
||||
|
||||
//prepare breadcrumbs (initialize a static var)
|
||||
breadcrumbs();
|
||||
|
||||
//close session
|
||||
session_write_close();
|
||||
|
||||
//do the work
|
||||
act_dispatch($ACT);
|
||||
|
||||
//restore old umask
|
||||
|
|
5
feed.php
5
feed.php
|
@ -13,13 +13,16 @@
|
|||
require_once(DOKU_INC.'inc/feedcreator.class.php');
|
||||
require_once(DOKU_INC.'inc/auth.php');
|
||||
|
||||
//set auth header for login
|
||||
//set auth header for login FIXME: is this used anymore???
|
||||
if($_REQUEST['login'] && !isset($_SERVER['PHP_AUTH_USER'])){
|
||||
header('WWW-Authenticate: Basic realm="'.$conf['title'].'"');
|
||||
header('HTTP/1.0 401 Unauthorized');
|
||||
auth_logoff();
|
||||
}
|
||||
|
||||
//close sesseion
|
||||
session_write_close();
|
||||
|
||||
|
||||
$num = $_REQUEST['num'];
|
||||
$type = $_REQUEST['type'];
|
||||
|
|
|
@ -119,6 +119,10 @@ function msg($message,$lvl=0){
|
|||
* @author Andreas Gohr <andi@splitbrain.org>
|
||||
*/
|
||||
function breadcrumbs(){
|
||||
// we prepare the breadcrumbs early for quick session closing
|
||||
static $crumbs = null;
|
||||
if($crumbs != null) return $crumbs;
|
||||
|
||||
global $ID;
|
||||
global $ACT;
|
||||
global $conf;
|
||||
|
|
|
@ -16,6 +16,8 @@ require_once(DOKU_INC.'inc/init.php');
|
|||
require_once(DOKU_INC.'inc/common.php');
|
||||
require_once(DOKU_INC.'inc/pageutils.php');
|
||||
require_once(DOKU_INC.'inc/auth.php');
|
||||
//close sesseion
|
||||
session_write_close();
|
||||
|
||||
header('Content-Type: text/html; charset=utf-8');
|
||||
|
||||
|
|
|
@ -12,6 +12,9 @@
|
|||
require_once(DOKU_INC.'inc/pageutils.php');
|
||||
require_once(DOKU_INC.'inc/confutils.php');
|
||||
require_once(DOKU_INC.'inc/auth.php');
|
||||
//close sesseion
|
||||
session_write_close();
|
||||
|
||||
$mimetypes = getMimeTypes();
|
||||
|
||||
//get input
|
||||
|
|
|
@ -8,6 +8,8 @@
|
|||
require_once(DOKU_INC.'inc/search.php');
|
||||
require_once(DOKU_INC.'inc/template.php');
|
||||
require_once(DOKU_INC.'inc/auth.php');
|
||||
//close sesseion
|
||||
session_write_close();
|
||||
|
||||
header('Content-Type: text/html; charset='.$lang['encoding']);
|
||||
|
||||
|
|
Loading…
Reference in New Issue