From 1da2a264d5f4acfced8f76c28636e58db39b30be Mon Sep 17 00:00:00 2001 From: Michael Wallner Date: Mon, 27 Mar 2006 09:28:03 +0000 Subject: [PATCH] - override INI(http.force_exit) when calling http_exit() in ob_etaghandler - check if ob is locked in http_exit() --- http_api.c | 4 +++- http_cache_api.c | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/http_api.c b/http_api.c index 774e603..5946680 100644 --- a/http_api.c +++ b/http_api.c @@ -147,7 +147,9 @@ STATUS _http_exit_ex(int status, char *header, char *body, zend_bool send_header return FAILURE; } - php_end_ob_buffers(0 TSRMLS_CC); + if (!OG(ob_lock)) { + php_end_ob_buffers(0 TSRMLS_CC); + } if ((SUCCESS == sapi_send_headers(TSRMLS_C)) && body) { PHPWRITE(body, strlen(body)); } diff --git a/http_cache_api.c b/http_cache_api.c index 582c3cc..8326564 100644 --- a/http_cache_api.c +++ b/http_cache_api.c @@ -230,6 +230,8 @@ void _http_ob_etaghandler(char *output, uint output_len, http_send_etag_ex(etag, strlen(etag), &sent_header); if (http_match_etag("HTTP_IF_NONE_MATCH", etag)) { + /* force exit; ob within ob does not work */ + HTTP_G->force_exit = 1; http_exit_ex(304, sent_header, etag, 0); } -- 2.30.2