|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2003-08-13 04:16 UTC] akss at plesk dot ru
Description: ------------ php-4.3.2 Windows hangs at frequent references to the pages using the sessions mechanism. This is because too many locks are created for a session file "sess_xxx". PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Oct 28 11:00:01 2025 UTC |
Patch for fix ext/session/mod_files.c on windows: --- mod_files.c.orig Tue May 20 20:01:54 2003 +++ mod_files.c Fri Aug 15 05:12:40 2003 @@ -124,6 +124,7 @@ static void ps_files_close(ps_files *data) { if (data->fd != -1) { + flock(data->fd, LOCK_UN); close(data->fd); data->fd = -1; } @@ -275,8 +276,10 @@ if (data->fd < 0) return FAILURE; - if (fstat(data->fd, &sbuf)) + if (fstat(data->fd, &sbuf)) { + flock(data->fd, LOCK_UN); return FAILURE; + } data->st_size = *vallen = sbuf.st_size; *val = emalloc(sbuf.st_size); @@ -287,6 +290,7 @@ lseek(data->fd, 0, SEEK_SET); n = read(data->fd, *val, sbuf.st_size); #endif + flock(data->fd, LOCK_UN); if (n != sbuf.st_size) { if (n == -1) @@ -325,6 +329,7 @@ lseek(data->fd, 0, SEEK_SET); n = write(data->fd, val, vallen); #endif + flock(data->fd, LOCK_UN); if (n != vallen) { if (n == -1) Other case apache hangs up.Unfortunatelly i can't give a code. It closed development. And i have not time now for produce purified test example. I try to describe 1 Create page with form with 2 input fields login & pass and submit button (login page). 2 Create auto prepend file with session check. If no session go to login page. 3 Change session parameters in auto prepend file ini_set('session.gc_probability', 1-5); session_save_path('deep 4-5'); ini_set('session.gc_maxlifetime', near 20000); 4 On login submit create session. Put to her both parameter login and pass. If session created (parameters setted) redirect to other pages with 2-3 frames which check session settings too. 5 Made many quickly switchings over this frames. 1st, 2nd, 3d, again 1st. 6 Apache without patch hangs up.