- Fixed build on php-trunk
[m6w6/ext-http] / http_api.c
index aca90e669f5adeed209212cb1fbbc86bb34827e1..aebd434209deb323f2c2ba3dac0b73649f276222 100644 (file)
@@ -253,9 +253,15 @@ STATUS _http_exit_ex(int status, char *header, char *body, zend_bool send_header
                return FAILURE;
        }
        
+#if PHP_VERSION_ID < 50399
        if (!OG(ob_lock)) {
                php_end_ob_buffers(0 TSRMLS_CC);
        }
+#else
+       if (php_output_get_status(TSRMLS_C) & PHP_OUTPUT_LOCKED) {
+               php_output_end_all(TSRMLS_C);
+       }
+#endif
        if ((SUCCESS == sapi_send_headers(TSRMLS_C)) && body) {
                PHPWRITE(body, strlen(body));
        }