branch off v1 as R_1_7
[m6w6/ext-http] / http_send_api.c
index d8bc1a0e57f7a0d1277c72b21080f0f7e9940252..1082e296460651f289dae088a558421e7505bf8b 100644 (file)
@@ -34,23 +34,15 @@ static inline void _http_flush(void *nothing, const char *data, size_t data_len
        /*      we really only need to flush when throttling is enabled,
                because we push the data as fast as possible anyway if not */
        if (HTTP_G->send.throttle_delay >= HTTP_DIFFSEC) {
-#if PHP_VERSION_ID < 50399
+#if defined(PHP_VERSION_ID) && (PHP_VERSION_ID >= 50399)
+               php_output_end_all(TSRMLS_C);
+#else
                if (OG(ob_nesting_level)) {
                        php_end_ob_buffer(1, 1 TSRMLS_CC);
                }
                if (!OG(implicit_flush)) {
                        sapi_flush(TSRMLS_C);
                }
-#else
-               int ob_level;
-               
-               if ((php_output_handler_hook(PHP_OUTPUT_HANDLER_HOOK_GET_LEVEL, &ob_level TSRMLS_CC) == SUCCESS) && ob_level > 0) {
-                       php_output_discard(TSRMLS_C);
-               }
-               
-               if (php_output_get_status(TSRMLS_C) & PHP_OUTPUT_IMPLICITFLUSH) {
-                       sapi_flush(TSRMLS_C);
-               }
 #endif
                http_sleep(HTTP_G->send.throttle_delay);
        }