Permalink
Browse files

Fixed bug#55084 (Function registered by header_register_callback is

called only once per process). (Hannes)

also fixed an issue when header()s are sent from the callback function
  • Loading branch information...
bjori committed Jul 6, 2011
1 parent b7e1240 commit 5ddd67d90b70bd9f2f8445dafd0656909ccf06ed
Showing with 9 additions and 1 deletion.
  1. +2 −0 NEWS
  2. +7 −1 main/SAPI.c
View
2 NEWS
@@ -141,6 +141,8 @@ PHP NEWS
separators to the first byte. FR #53457. (Adam)
. Added hex2bin() function. (Scott)
. Fixed crypt_blowfish handling of 8-bit characters. (Stas) (CVE-2011-2483)
+ . Fixed bug#55084 (Function registered by header_register_callback is
+ called only once per process). (Hannes)
- Improved CURL extension:
. Added support for CURLOPT_MAX_RECV_SPEED_LARGE and
View
@@ -430,6 +430,8 @@ SAPI_API void sapi_activate(TSRMLS_D)
SG(sapi_headers).http_status_line = NULL;
SG(sapi_headers).mimetype = NULL;
SG(headers_sent) = 0;
+ SG(callback_run) = 0;
+ SG(callback_func) = NULL;
SG(read_post_bytes) = 0;
SG(request_info).post_data = NULL;
SG(request_info).raw_post_data = NULL;
@@ -539,6 +541,10 @@ SAPI_API void sapi_deactivate(TSRMLS_D)
sapi_send_headers_free(TSRMLS_C);
SG(sapi_started) = 0;
SG(headers_sent) = 0;
+ SG(callback_run) = 0;
+ if (SG(callback_func)) {
+ zval_ptr_dtor(&SG(callback_func));
+ }
SG(request_info).headers_read = 0;
SG(global_request_time) = 0;
}
@@ -816,7 +822,7 @@ SAPI_API int sapi_send_headers(TSRMLS_D)
int retval;
int ret = FAILURE;
- if (SG(headers_sent) || SG(request_info).no_headers) {
+ if (SG(headers_sent) || SG(request_info).no_headers || SG(callback_run)) {
return SUCCESS;
}

0 comments on commit 5ddd67d

Please sign in to comment.