mirror of
https://github.com/php/php-src.git
synced 2025-08-17 22:48:57 +02:00
Use synchronous php_request_shutdown in the standard case and
let the pool cleanup function only become effective, when an error has occured. This fixes the problem that the request_conn was already dead when the request_shutdown was reached.
This commit is contained in:
parent
e5204748f7
commit
36be1040eb
2 changed files with 10 additions and 5 deletions
|
@ -312,9 +312,11 @@ static void php_apache_request_shutdown(void *dummy)
|
||||||
SLS_FETCH();
|
SLS_FETCH();
|
||||||
APLS_FETCH();
|
APLS_FETCH();
|
||||||
|
|
||||||
AP(in_request)=0;
|
|
||||||
SG(server_context) = NULL; /* The server context (request) is invalid by the time run_cleanups() is called */
|
SG(server_context) = NULL; /* The server context (request) is invalid by the time run_cleanups() is called */
|
||||||
php_request_shutdown(dummy);
|
if (AP(in_request)) {
|
||||||
|
AP(in_request) = 0;
|
||||||
|
php_request_shutdown(dummy);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
/* }}} */
|
/* }}} */
|
||||||
|
|
||||||
|
|
|
@ -56,13 +56,14 @@
|
||||||
#include "ext/standard/php_standard.h"
|
#include "ext/standard/php_standard.h"
|
||||||
#include "util_script.h"
|
#include "util_script.h"
|
||||||
#include "php_version.h"
|
#include "php_version.h"
|
||||||
/*#include "mod_php4.h"*/
|
#include "mod_php4.h"
|
||||||
|
|
||||||
/* {{{ apache_php_module_main
|
/* {{{ apache_php_module_main
|
||||||
*/
|
*/
|
||||||
int apache_php_module_main(request_rec *r, int display_source_mode CLS_DC ELS_DC PLS_DC SLS_DC)
|
int apache_php_module_main(request_rec *r, int display_source_mode CLS_DC ELS_DC PLS_DC SLS_DC)
|
||||||
{
|
{
|
||||||
zend_file_handle file_handle;
|
zend_file_handle file_handle;
|
||||||
|
APLS_FETCH();
|
||||||
|
|
||||||
if (php_request_startup(CLS_C ELS_CC PLS_CC SLS_CC) == FAILURE) {
|
if (php_request_startup(CLS_C ELS_CC PLS_CC SLS_CC) == FAILURE) {
|
||||||
return FAILURE;
|
return FAILURE;
|
||||||
|
@ -90,10 +91,12 @@ int apache_php_module_main(request_rec *r, int display_source_mode CLS_DC ELS_DC
|
||||||
(void) php_execute_script(&file_handle CLS_CC ELS_CC PLS_CC);
|
(void) php_execute_script(&file_handle CLS_CC ELS_CC PLS_CC);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
AP(in_request) = 0;
|
||||||
|
|
||||||
zend_try {
|
zend_try {
|
||||||
php_end_ob_buffers(1);
|
php_request_shutdown(NULL);
|
||||||
php_header(); /* Make sure headers have been sent */
|
|
||||||
} zend_end_try();
|
} zend_end_try();
|
||||||
|
|
||||||
return (OK);
|
return (OK);
|
||||||
}
|
}
|
||||||
/* }}} */
|
/* }}} */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue