From ade8255b0acd90338f0c5d724f15ebdfca8193e6 Mon Sep 17 00:00:00 2001 From: Xuefer Date: Mon, 2 Oct 2006 01:09:56 +0000 Subject: [PATCH] fixed #42, conflict between xcache sandbox and user error handler git-svn-id: svn://svn.lighttpd.net/xcache/trunk@209 c26eb9a1-5813-0410-bd6c-c2e55f420ca7 --- utils.c | 11 ++++++++++- utils.h | 1 + 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/utils.c b/utils.c index 0072a79..b761900 100644 --- a/utils.c +++ b/utils.c @@ -396,6 +396,11 @@ xc_sandbox_t *xc_sandbox_init(xc_sandbox_t *sandbox, char *filename TSRMLS_DC) / sandbox->filename = filename; +#ifdef E_STRICT + sandbox->orig_user_error_handler_error_reporting = EG(user_error_handler_error_reporting); + EG(user_error_handler_error_reporting) &= ~E_STRICT; +#endif + return sandbox; } /* }}} */ @@ -427,7 +432,7 @@ static void xc_sandbox_install(xc_sandbox_t *sandbox TSRMLS_DC) /* {{{ */ b = TG(class_table).pListHead; /* install class */ while (b != NULL) { - xc_install_class(sandbox->filename, (xc_cest_t*)b->pData, + xc_install_class(sandbox->filename, (xc_cest_t*) b->pData, -1, BUCKET_KEY_TYPE(b), ZSTR(BUCKET_KEY_S(b)), b->nKeyLength TSRMLS_CC); b = b->pListNext; } @@ -468,6 +473,10 @@ void xc_sandbox_free(xc_sandbox_t *sandbox, int install TSRMLS_DC) /* {{{ */ /* restore orig here, as EG/CG holded tmp before */ memcpy(&EG(included_files), &OG(included_files), sizeof(EG(included_files))); +#ifdef E_STRICT + EG(user_error_handler_error_reporting) = sandbox->orig_user_error_handler_error_reporting; +#endif + if (sandbox->alloc) { efree(sandbox); } diff --git a/utils.h b/utils.h index 4268dd8..f6034aa 100644 --- a/utils.h +++ b/utils.h @@ -34,6 +34,7 @@ ZESW(xc_cest_t *, void) xc_install_class(char *filename, xc_cest_t *cest, zend_u /* sandbox */ typedef struct { int alloc; + int orig_user_error_handler_error_reporting; char *filename; HashTable orig_included_files;