version 1.1.1.3, 2013/07/22 01:32:11
|
version 1.1.1.4, 2014/06/15 20:04:01
|
Line 2
|
Line 2
|
+----------------------------------------------------------------------+ |
+----------------------------------------------------------------------+ |
| PHP Version 5 | |
| PHP Version 5 | |
+----------------------------------------------------------------------+ |
+----------------------------------------------------------------------+ |
| Copyright (c) 1997-2013 The PHP Group | | | Copyright (c) 1997-2014 The PHP Group | |
+----------------------------------------------------------------------+ |
+----------------------------------------------------------------------+ |
| This source file is subject to version 3.01 of the PHP license, | |
| This source file is subject to version 3.01 of the PHP license, | |
| that is bundled with this package in the file LICENSE, and is | |
| that is bundled with this package in the file LICENSE, and is | |
Line 137 PHP_FUNCTION(header_register_callback)
|
Line 137 PHP_FUNCTION(header_register_callback)
|
efree(callback_name); |
efree(callback_name); |
RETURN_FALSE; |
RETURN_FALSE; |
} |
} |
|
|
efree(callback_name); |
efree(callback_name); |
|
|
if (SG(callback_func)) { |
if (SG(callback_func)) { |
Line 144 PHP_FUNCTION(header_register_callback)
|
Line 145 PHP_FUNCTION(header_register_callback)
|
SG(fci_cache) = empty_fcall_info_cache; |
SG(fci_cache) = empty_fcall_info_cache; |
} |
} |
|
|
Z_ADDREF_P(callback_func); |
|
|
|
SG(callback_func) = callback_func; |
SG(callback_func) = callback_func; |
| |
| Z_ADDREF_P(SG(callback_func)); |
| |
RETURN_TRUE; |
RETURN_TRUE; |
} |
} |
/* }}} */ |
/* }}} */ |
Line 156 static void sapi_run_header_callback(TSRMLS_D)
|
Line 157 static void sapi_run_header_callback(TSRMLS_D)
|
{ |
{ |
int error; |
int error; |
zend_fcall_info fci; |
zend_fcall_info fci; |
|
char *callback_name = NULL; |
|
char *callback_error = NULL; |
zval *retval_ptr = NULL; |
zval *retval_ptr = NULL; |
| |
fci.size = sizeof(fci); | if (zend_fcall_info_init(SG(callback_func), 0, &fci, &SG(fci_cache), &callback_name, &callback_error TSRMLS_CC) == SUCCESS) { |
fci.function_table = EG(function_table); | fci.retval_ptr_ptr = &retval_ptr; |
fci.object_ptr = NULL; | |
fci.function_name = SG(callback_func); | error = zend_call_function(&fci, &SG(fci_cache) TSRMLS_CC); |
fci.retval_ptr_ptr = &retval_ptr; | if (error == FAILURE) { |
fci.param_count = 0; | goto callback_failed; |
fci.params = NULL; | } else if (retval_ptr) { |
fci.no_separation = 0; | zval_ptr_dtor(&retval_ptr); |
fci.symbol_table = NULL; | } |
| } else { |
error = zend_call_function(&fci, &SG(fci_cache) TSRMLS_CC); | callback_failed: |
if (error == FAILURE) { | |
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not call the sapi_header_callback"); |
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not call the sapi_header_callback"); |
} else if (retval_ptr) { |
|
zval_ptr_dtor(&retval_ptr); |
|
} |
} |
|
|
|
if (callback_name) { |
|
efree(callback_name); |
|
} |
|
if (callback_error) { |
|
efree(callback_error); |
|
} |
} |
} |
|
|
SAPI_API void sapi_handle_post(void *arg TSRMLS_DC) |
SAPI_API void sapi_handle_post(void *arg TSRMLS_DC) |
Line 710 SAPI_API int sapi_header_op(sapi_header_op_enum op, vo
|
Line 717 SAPI_API int sapi_header_op(sapi_header_op_enum op, vo
|
|
|
header_line = estrndup(header_line, header_line_len); |
header_line = estrndup(header_line, header_line_len); |
|
|
/* cut of trailing spaces, linefeeds and carriage-returns */ | /* cut off trailing spaces, linefeeds and carriage-returns */ |
if (header_line_len && isspace(header_line[header_line_len-1])) { |
if (header_line_len && isspace(header_line[header_line_len-1])) { |
do { |
do { |
header_line_len--; |
header_line_len--; |