X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=http_api.c;h=59466806a03e80b2bd0fd46aac0856ea9657e08f;hb=8d980e09a008a1c223be1a068ab522750f8bbdad;hp=811acba2f6dc3470459d72b9f3dfed5b2269a3ca;hpb=e6b35fbe072a13b0e792952852fcd1499bd8e610;p=m6w6%2Fext-http diff --git a/http_api.c b/http_api.c index 811acba..5946680 100644 --- a/http_api.c +++ b/http_api.c @@ -116,7 +116,7 @@ void _http_log_ex(char *file, const char *ident, const char *message TSRMLS_DC) #define HTTP_LOG_WRITE(file, type, msg) \ if (file && *file) { \ - php_stream *log = php_stream_open_wrapper(file, "ab", REPORT_ERRORS|ENFORCE_SAFE_MODE, NULL); \ + php_stream *log = php_stream_open_wrapper_ex(file, "ab", REPORT_ERRORS|ENFORCE_SAFE_MODE, NULL, HTTP_DEFAULT_STREAM_CONTEXT); \ \ if (log) { \ php_stream_printf(log TSRMLS_CC, "%s\t[%s]\t%s\t<%s>%s", datetime, type, msg, SG(request_info).request_uri, PHP_EOL); \ @@ -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)); } @@ -196,7 +198,9 @@ PHP_HTTP_API zval *_http_get_server_var_ex(const char *key, size_t key_size, zen { zval **hsv; zval **var; - +#ifdef ZEND_ENGINE_2 + zend_is_auto_global("_SERVER", lenof("_SERVER") TSRMLS_CC); +#endif if ((SUCCESS != zend_hash_find(&EG(symbol_table), "_SERVER", sizeof("_SERVER"), (void **) &hsv)) || (Z_TYPE_PP(hsv) != IS_ARRAY)) { return NULL; }