- override INI(http.force_exit) when calling http_exit() in ob_etaghandler
authorMichael Wallner <mike@php.net>
Mon, 27 Mar 2006 09:28:03 +0000 (09:28 +0000)
committerMichael Wallner <mike@php.net>
Mon, 27 Mar 2006 09:28:03 +0000 (09:28 +0000)
- check if ob is locked in http_exit()

http_api.c
http_cache_api.c

index 774e60335a1c70d7bb537bc6a6de88cacb8376e8..59466806a03e80b2bd0fd46aac0856ea9657e08f 100644 (file)
@@ -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));
        }
index 582c3ccd455d764b26fcec0134ec58dff88080ea..832656466972a38be1a69ead9a98e14f798b4fb9 100644 (file)
@@ -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);
                        }