From 2b7331c5fdb73cb48f7f60a8e4ec88766581ced3 Mon Sep 17 00:00:00 2001 From: Michael Wallner Date: Tue, 26 Apr 2005 15:37:49 +0000 Subject: [PATCH 1/1] - unified cache_api function names - moved http_ob_etaghandler() to cache_api - don't pretend to be smarter than the developer at etag caching; removed http_start_ob_buffer, etc; - renamed ob_httpetaghandler to ob_etaghandler --- http.c | 2 +- http_api.c | 96 ---------------------------- http_cache_api.c | 117 +++++++++++++++++++++++----------- http_functions.c | 34 +++------- http_methods.c | 6 +- http_send_api.c | 28 ++++---- php_http.h | 2 +- php_http_api.h | 3 - php_http_cache_api.h | 19 +++--- tests/split_response_001.phpt | 6 +- 10 files changed, 122 insertions(+), 191 deletions(-) diff --git a/http.c b/http.c index 0c6f5b6..494a1aa 100644 --- a/http.c +++ b/http.c @@ -113,7 +113,7 @@ function_entry http_functions[] = { #ifndef ZEND_ENGINE_2 PHP_FE(http_build_query, NULL) #endif - PHP_FE(ob_httpetaghandler, NULL) + PHP_FE(ob_etaghandler, NULL) {NULL, NULL, NULL} }; /* }}} */ diff --git a/http_api.c b/http_api.c index 9960f2b..e9f3bf0 100644 --- a/http_api.c +++ b/http_api.c @@ -22,14 +22,10 @@ #include #include "php.h" -#include "php_output.h" -#include "ext/standard/md5.h" #include "php_http.h" #include "php_http_std_defs.h" #include "php_http_api.h" -#include "php_http_send_api.h" -#include "php_http_cache_api.h" #include "php_http_headers_api.h" #ifdef ZEND_ENGINE_2 @@ -85,21 +81,6 @@ void _http_error_ex(long type, long code, const char *format, ...) } /* }}} */ -/* {{{ static STATUS http_ob_stack_get(php_ob_buffer *, php_ob_buffer **) */ -static STATUS http_ob_stack_get(php_ob_buffer *o, php_ob_buffer **s) -{ - static int i = 0; - php_ob_buffer *b = emalloc(sizeof(php_ob_buffer)); - b->handler_name = estrdup(o->handler_name); - b->buffer = estrndup(o->buffer, o->text_length); - b->text_length = o->text_length; - b->chunk_size = o->chunk_size; - b->erase = o->erase; - s[i++] = b; - return SUCCESS; -} -/* }}} */ - /* {{{ zval *http_get_server_var_ex(char *, size_t) */ PHP_HTTP_API zval *_http_get_server_var_ex(const char *key, size_t key_size, zend_bool check TSRMLS_DC) { @@ -115,83 +96,6 @@ PHP_HTTP_API zval *_http_get_server_var_ex(const char *key, size_t key_size, zen } /* }}} */ -/* {{{ void http_ob_etaghandler(char *, uint, char **, uint *, int) */ -PHP_HTTP_API void _http_ob_etaghandler(char *output, uint output_len, - char **handled_output, uint *handled_output_len, int mode TSRMLS_DC) -{ - char etag[33] = { 0 }; - unsigned char digest[16]; - - if (mode & PHP_OUTPUT_HANDLER_START) { - PHP_MD5Init(&HTTP_G(etag_md5)); - } - - PHP_MD5Update(&HTTP_G(etag_md5), output, output_len); - - if (mode & PHP_OUTPUT_HANDLER_END) { - PHP_MD5Final(digest, &HTTP_G(etag_md5)); - - /* just do that if desired */ - if (HTTP_G(etag_started)) { - make_digest(etag, digest); - - if (http_etag_match("HTTP_IF_NONE_MATCH", etag)) { - http_send_status(304); - zend_bailout(); - } else { - http_send_etag(etag, 32); - } - } - } - - *handled_output_len = output_len; - *handled_output = estrndup(output, output_len); -} -/* }}} */ - -/* {{{ STATUS http_start_ob_handler(php_output_handler_func_t, char *, uint, zend_bool) */ -PHP_HTTP_API STATUS _http_start_ob_handler(php_output_handler_func_t handler_func, - char *handler_name, uint chunk_size, zend_bool erase TSRMLS_DC) -{ - php_ob_buffer **stack; - int count, i; - - if (count = OG(ob_nesting_level)) { - stack = ecalloc(count, sizeof(php_ob_buffer *)); - - if (count > 1) { - zend_stack_apply_with_argument(&OG(ob_buffers), ZEND_STACK_APPLY_BOTTOMUP, - (int (*)(void *elem, void *)) http_ob_stack_get, stack); - } - - if (count > 0) { - http_ob_stack_get(&OG(active_ob_buffer), stack); - } - - while (OG(ob_nesting_level)) { - php_end_ob_buffer(0, 0 TSRMLS_CC); - } - } - - php_ob_set_internal_handler(handler_func, chunk_size, handler_name, erase TSRMLS_CC); - - for (i = 0; i < count; i++) { - php_ob_buffer *s = stack[i]; - if (strcmp(s->handler_name, "default output handler")) { - php_start_ob_buffer_named(s->handler_name, s->chunk_size, s->erase TSRMLS_CC); - } - php_body_write(s->buffer, s->text_length TSRMLS_CC); - efree(s->handler_name); - efree(s->buffer); - efree(s); - } - if (count) { - efree(stack); - } - - return SUCCESS; -} -/* }}} */ /* {{{ STATUS http_chunked_decode(char *, size_t, char **, size_t *) */ PHP_HTTP_API STATUS _http_chunked_decode(const char *encoded, size_t encoded_len, diff --git a/http_cache_api.c b/http_cache_api.c index 7d61040..7fc25cf 100644 --- a/http_cache_api.c +++ b/http_cache_api.c @@ -21,13 +21,14 @@ #include "php.h" #include "php_streams.h" +#include "php_output.h" #include "ext/standard/md5.h" #include "php_http.h" #include "php_http_std_defs.h" +#include "php_http_api.h" #include "php_http_cache_api.h" #include "php_http_send_api.h" -#include "php_http_api.h" #include "php_http_date_api.h" ZEND_EXTERN_MODULE_GLOBALS(http); @@ -75,8 +76,8 @@ PHP_HTTP_API char *_http_etag(const void *data_ptr, size_t data_len, http_send_m } /* }}} */ -/* {{{ time_t http_lmod(void *, http_send_mode) */ -PHP_HTTP_API time_t _http_lmod(const void *data_ptr, http_send_mode data_mode TSRMLS_DC) +/* {{{ time_t http_last_modified(void *, http_send_mode) */ +PHP_HTTP_API time_t _http_last_modified(const void *data_ptr, http_send_mode data_mode TSRMLS_DC) { switch (data_mode) { @@ -100,8 +101,8 @@ PHP_HTTP_API time_t _http_lmod(const void *data_ptr, http_send_mode data_mode TS } /* }}} */ -/* {{{ zend_bool http_modified_match(char *, time_t) */ -PHP_HTTP_API zend_bool _http_modified_match_ex(const char *entry, time_t t, zend_bool enforce_presence TSRMLS_DC) +/* {{{ zend_bool http_match_last_modified(char *, time_t) */ +PHP_HTTP_API zend_bool _http_match_last_modified_ex(const char *entry, time_t t, zend_bool enforce_presence TSRMLS_DC) { zend_bool retval; zval *zmodified; @@ -119,8 +120,8 @@ PHP_HTTP_API zend_bool _http_modified_match_ex(const char *entry, time_t t, zend } /* }}} */ -/* {{{ zend_bool http_etag_match(char *, char *) */ -PHP_HTTP_API zend_bool _http_etag_match_ex(const char *entry, const char *etag, zend_bool enforce_presence TSRMLS_DC) +/* {{{ zend_bool http_match_etag(char *, char *) */ +PHP_HTTP_API zend_bool _http_match_etag_ex(const char *entry, const char *etag, zend_bool enforce_presence TSRMLS_DC) { zval *zetag; char *quoted_etag; @@ -149,19 +150,19 @@ PHP_HTTP_API zend_bool _http_etag_match_ex(const char *entry, const char *etag, PHP_HTTP_API STATUS _http_cache_last_modified(time_t last_modified, time_t send_modified, const char *cache_control, size_t cc_len TSRMLS_DC) { - if (cc_len) { - http_send_cache_control(cache_control, cc_len); + if (cc_len && (SUCCESS != http_send_cache_control(cache_control, cc_len))) { + return FAILURE; } - if (http_modified_match("HTTP_IF_MODIFIED_SINCE", last_modified)) { - if (SUCCESS == http_send_status(304)) { - zend_bailout(); - } else { - http_error(E_WARNING, HTTP_E_HEADER, "Could not send 304 Not Modified"); - return FAILURE; - } + if (SUCCESS != http_send_last_modified(send_modified)) { + return FAILURE; + } + + if (http_match_last_modified("HTTP_IF_MODIFIED_SINCE", last_modified)) { + return http_cache_exit(); } - return http_send_last_modified(send_modified); + + return SUCCESS; } /* }}} */ @@ -169,36 +170,80 @@ PHP_HTTP_API STATUS _http_cache_last_modified(time_t last_modified, PHP_HTTP_API STATUS _http_cache_etag(const char *etag, size_t etag_len, const char *cache_control, size_t cc_len TSRMLS_DC) { - if (cc_len) { - http_send_cache_control(cache_control, cc_len); + if (cc_len && (SUCCESS != http_send_cache_control(cache_control, cc_len))) { + return FAILURE; } if (etag_len) { - http_send_etag(etag, etag_len); - if (http_etag_match("HTTP_IF_NONE_MATCH", etag)) { - if (SUCCESS == http_send_status(304)) { - zend_bailout(); - } else { - http_error(E_WARNING, HTTP_E_HEADER, "Could not send 304 Not Modified"); - return FAILURE; - } + if (SUCCESS != http_send_etag(etag, etag_len)) { + return FAILURE; } + if (!http_match_etag("HTTP_IF_NONE_MATCH", etag)) { + return SUCCESS; + } + return http_cache_exit(); } /* if no etag is given and we didn't already start ob_etaghandler -- start it */ - if (!HTTP_G(etag_started)) { - if (SUCCESS == http_start_ob_handler(_http_ob_etaghandler, "ob_etaghandler", 4096, 1)) { - HTTP_G(etag_started) = 1; - return SUCCESS; - } else { - http_error(E_WARNING, HTTP_E_OBUFFER, "Could not start ob_etaghandler"); - return FAILURE; - } + if (HTTP_G(etag_started)) { + return SUCCESS; } - return SUCCESS; + + if (HTTP_G(etag_started) = (SUCCESS == php_start_ob_buffer_named("ob_etaghandler", HTTP_SENDBUF_SIZE, 1 TSRMLS_CC))) { + return SUCCESS; + } else { + return FAILURE; + } + } /* }}} */ +/* {{{ STATUS http_cache_exit() */ +PHP_HTTP_API STATUS _http_cache_exit(TSRMLS_D) +{ + if (SUCCESS != http_send_status(304)) { + http_error(E_WARNING, HTTP_E_HEADER, "Could not send 304 Not Modified"); + return FAILURE; + } + /* TODO: cache_log */ + zend_bailout(); + return SUCCESS; /* fake */ +} +/* }}} */ + +/* {{{ void http_ob_etaghandler(char *, uint, char **, uint *, int) */ +PHP_HTTP_API void _http_ob_etaghandler(char *output, uint output_len, + char **handled_output, uint *handled_output_len, int mode TSRMLS_DC) +{ + char etag[33] = { 0 }; + unsigned char digest[16]; + + if (mode & PHP_OUTPUT_HANDLER_START) { + HTTP_G(etag_started) = 1; + PHP_MD5Init(&HTTP_G(etag_md5)); + } + + PHP_MD5Update(&HTTP_G(etag_md5), output, output_len); + + if (mode & PHP_OUTPUT_HANDLER_END) { + PHP_MD5Final(digest, &HTTP_G(etag_md5)); + + /* just do that if desired */ + if (HTTP_G(etag_started)) { + make_digest(etag, digest); + http_send_header("Cache-Control: " HTTP_DEFAULT_CACHECONTROL); + http_send_etag(etag, 32); + + if (http_match_etag("HTTP_IF_NONE_MATCH", etag)) { + http_cache_exit(); + } + } + } + + *handled_output_len = output_len; + *handled_output = estrndup(output, output_len); +} +/* }}} */ /* * Local variables: diff --git a/http_functions.c b/http_functions.c index 96f3277..ffc84c3 100644 --- a/http_functions.c +++ b/http_functions.c @@ -249,7 +249,7 @@ PHP_FUNCTION(http_send_content_type) } if (!ct_len) { - RETURN_SUCCESS(http_send_content_type("application/x-octetstream", sizeof("application/x-octetstream") - 1)); + RETURN_SUCCESS(http_send_content_type("application/x-octetstream", lenof("application/x-octetstream"))); } RETURN_SUCCESS(http_send_content_type(ct, ct_len)); } @@ -296,9 +296,9 @@ PHP_FUNCTION(http_match_modified) } if (for_range) { - RETURN_BOOL(http_modified_match("HTTP_IF_UNMODIFIED_SINCE", t)); + RETURN_BOOL(http_match_last_modified("HTTP_IF_UNMODIFIED_SINCE", t)); } - RETURN_BOOL(http_modified_match("HTTP_IF_MODIFIED_SINCE", t)); + RETURN_BOOL(http_match_last_modified("HTTP_IF_MODIFIED_SINCE", t)); } /* }}} */ @@ -319,9 +319,9 @@ PHP_FUNCTION(http_match_etag) } if (for_range) { - RETURN_BOOL(http_etag_match("HTTP_IF_MATCH", etag)); + RETURN_BOOL(http_match_etag("HTTP_IF_MATCH", etag)); } - RETURN_BOOL(http_etag_match("HTTP_IF_NONE_MATCH", etag)); + RETURN_BOOL(http_match_etag("HTTP_IF_NONE_MATCH", etag)); } /* }}} */ @@ -364,7 +364,7 @@ PHP_FUNCTION(http_cache_last_modified) send_modified = last_modified; } - RETURN_SUCCESS(http_cache_last_modified(last_modified, send_modified, HTTP_DEFAULT_CACHECONTROL, sizeof(HTTP_DEFAULT_CACHECONTROL) - 1)); + RETURN_SUCCESS(http_cache_last_modified(last_modified, send_modified, HTTP_DEFAULT_CACHECONTROL, lenof(HTTP_DEFAULT_CACHECONTROL))); } /* }}} */ @@ -388,17 +388,15 @@ PHP_FUNCTION(http_cache_etag) RETURN_FALSE; } - RETURN_SUCCESS(http_cache_etag(etag, etag_len, HTTP_DEFAULT_CACHECONTROL, sizeof(HTTP_DEFAULT_CACHECONTROL) - 1)); + RETURN_SUCCESS(http_cache_etag(etag, etag_len, HTTP_DEFAULT_CACHECONTROL, lenof(HTTP_DEFAULT_CACHECONTROL))); } /* }}} */ -/* {{{ proto string ob_httpetaghandler(string data, int mode) +/* {{{ proto string ob_etaghandler(string data, int mode) * * For use with ob_start(). - * Note that this has to be started as first output buffer. - * WARNING: Don't use with http_send_*(). */ -PHP_FUNCTION(ob_httpetaghandler) +PHP_FUNCTION(ob_etaghandler) { char *data; int data_len; @@ -408,20 +406,6 @@ PHP_FUNCTION(ob_httpetaghandler) RETURN_FALSE; } - if (mode & PHP_OUTPUT_HANDLER_START) { - if (HTTP_G(etag_started)) { - http_error(E_WARNING, HTTP_E_OBUFFER, "ob_httpetaghandler can only be used once"); - RETURN_STRINGL(data, data_len, 1); - } - http_send_header("Cache-Control: " HTTP_DEFAULT_CACHECONTROL); - HTTP_G(etag_started) = 1; - } - - if (OG(ob_nesting_level) > 1) { - http_error(E_WARNING, HTTP_E_OBUFFER, "ob_httpetaghandler must be started prior to other output buffers"); - RETURN_STRINGL(data, data_len, 1); - } - Z_TYPE_P(return_value) = IS_STRING; http_ob_etaghandler(data, data_len, &Z_STRVAL_P(return_value), &Z_STRLEN_P(return_value), mode); } diff --git a/http_methods.c b/http_methods.c index 6558b4f..b65fbda 100644 --- a/http_methods.c +++ b/http_methods.c @@ -323,7 +323,7 @@ PHP_METHOD(HttpResponse, setData) convert_to_string_ex(&the_data); SET_PROP(obj, data, the_data); - UPD_PROP(obj, long, lastModified, http_lmod(the_data, SEND_DATA)); + UPD_PROP(obj, long, lastModified, http_last_modified(the_data, SEND_DATA)); UPD_PROP(obj, long, send_mode, SEND_DATA); RETURN_TRUE; } @@ -362,7 +362,7 @@ PHP_METHOD(HttpResponse, setStream) php_stream_from_zval(the_real_stream, &the_stream); SET_PROP(obj, stream, the_stream); - UPD_PROP(obj, long, lastModified, http_lmod(the_real_stream, SEND_RSRC)); + UPD_PROP(obj, long, lastModified, http_last_modified(the_real_stream, SEND_RSRC)); UPD_PROP(obj, long, send_mode, SEND_RSRC); RETURN_TRUE; } @@ -400,7 +400,7 @@ PHP_METHOD(HttpResponse, setFile) convert_to_string_ex(&the_file); UPD_PROP(obj, string, file, Z_STRVAL_P(the_file)); - UPD_PROP(obj, long, lastModified, http_lmod(the_file, -1)); + UPD_PROP(obj, long, lastModified, http_last_modified(the_file, -1)); UPD_PROP(obj, long, send_mode, -1); RETURN_TRUE; } diff --git a/http_send_api.c b/http_send_api.c index 9318efd..52e2b83 100644 --- a/http_send_api.c +++ b/http_send_api.c @@ -325,10 +325,8 @@ PHP_HTTP_API STATUS _http_send(const void *data_ptr, size_t data_size, http_send /* stop on-the-fly etag generation */ if (cache_etag = HTTP_G(etag_started)) { - /* interrupt */ + /* interrupt ob_etaghandler */ HTTP_G(etag_started) = 0; - /* never ever use the output to compute the ETag if http_send() is used */ - php_end_ob_buffers(0 TSRMLS_CC); } zend_hash_init(&ranges, 0, NULL, ZVAL_PTR_DTOR, 0); @@ -342,8 +340,8 @@ PHP_HTTP_API STATUS _http_send(const void *data_ptr, size_t data_size, http_send /* Range Request - only send ranges if entity hasn't changed */ if ( range_status == RANGE_OK && - http_etag_match_ex("HTTP_IF_MATCH", HTTP_G(etag), 0) && - http_modified_match_ex("HTTP_IF_UNMODIFIED_SINCE", HTTP_G(lmod), 0)) { + http_match_etag_ex("HTTP_IF_MATCH", HTTP_G(etag), 0) && + http_match_last_modified_ex("HTTP_IF_UNMODIFIED_SINCE", HTTP_G(lmod), 0)) { STATUS result = http_send_ranges(&ranges, data_ptr, data_size, data_mode); zend_hash_destroy(&ranges); return result; @@ -354,24 +352,24 @@ PHP_HTTP_API STATUS _http_send(const void *data_ptr, size_t data_size, http_send /* send 304 Not Modified if etag matches */ if (cache_etag) { char *etag = NULL; - int etag_match = 0; if (!(etag = http_etag(data_ptr, data_size, data_mode))) { return FAILURE; } - - http_send_etag(etag, 32); - etag_match = http_etag_match("HTTP_IF_NONE_MATCH", etag); - efree(etag); - - if (etag_match) { - return http_send_status(304); + if (SUCCESS != http_send_etag(etag, 32)) { + efree(etag); + return FAILURE; + } + if (http_match_etag("HTTP_IF_NONE_MATCH", etag)) { + efree(etag); + return http_cache_exit(); } + efree(etag); } /* send 304 Not Modified if last modified matches */ - if (http_modified_match("HTTP_IF_MODIFIED_SINCE", HTTP_G(lmod))) { - return http_send_status(304); + if (http_match_last_modified("HTTP_IF_MODIFIED_SINCE", HTTP_G(lmod))) { + return http_cache_exit(); } /* send full entity */ diff --git a/php_http.h b/php_http.h index a0e7722..737721d 100644 --- a/php_http.h +++ b/php_http.h @@ -88,7 +88,7 @@ PHP_FUNCTION(http_auth_basic_cb); #ifndef ZEND_ENGINE_2 PHP_FUNCTION(http_build_query); #endif /* ZEND_ENGINE_2 */ -PHP_FUNCTION(ob_httpetaghandler); +PHP_FUNCTION(ob_etaghandler); PHP_MINIT_FUNCTION(http); PHP_MSHUTDOWN_FUNCTION(http); diff --git a/php_http_api.h b/php_http_api.h index d08a2a9..b657222 100644 --- a/php_http_api.h +++ b/php_http_api.h @@ -40,9 +40,6 @@ PHP_HTTP_API zval *_http_get_server_var_ex(const char *key, size_t key_size, zen #define http_ob_etaghandler(o, l, ho, hl, m) _http_ob_etaghandler((o), (l), (ho), (hl), (m) TSRMLS_CC) PHP_HTTP_API void _http_ob_etaghandler(char *output, uint output_len, char **handled_output, uint *handled_output_len, int mode TSRMLS_DC); -#define http_start_ob_handler(f, h, s, e) _http_start_ob_handler((f), (h), (s), (e) TSRMLS_CC) -PHP_HTTP_API STATUS _http_start_ob_handler(php_output_handler_func_t handler_func, char *handler_name, uint chunk_size, zend_bool erase TSRMLS_DC); - #define http_chunked_decode(e, el, d, dl) _http_chunked_decode((e), (el), (d), (dl) TSRMLS_CC) PHP_HTTP_API STATUS _http_chunked_decode(const char *encoded, size_t encoded_len, char **decoded, size_t *decoded_len TSRMLS_DC); diff --git a/php_http_cache_api.h b/php_http_cache_api.h index 4f16957..30074cd 100644 --- a/php_http_cache_api.h +++ b/php_http_cache_api.h @@ -24,16 +24,16 @@ #define http_etag(p, l, m) _http_etag((p), (l), (m) TSRMLS_CC) PHP_HTTP_API char *_http_etag(const void *data_ptr, size_t data_len, http_send_mode data_mode TSRMLS_DC); -#define http_lmod(p, m) _http_lmod((p), (m) TSRMLS_CC) -PHP_HTTP_API time_t _http_lmod(const void *data_ptr, http_send_mode data_mode TSRMLS_DC); +#define http_last_modified(p, m) _http_last_modified((p), (m) TSRMLS_CC) +PHP_HTTP_API time_t _http_last_modified(const void *data_ptr, http_send_mode data_mode TSRMLS_DC); -#define http_modified_match(entry, modified) _http_modified_match_ex((entry), (modified), 1 TSRMLS_CC) -#define http_modified_match_ex(entry, modified, ep) _http_modified_match_ex((entry), (modified), (ep) TSRMLS_CC) -PHP_HTTP_API zend_bool _http_modified_match_ex(const char *entry, time_t t, zend_bool enforce_presence TSRMLS_DC); +#define http_match_last_modified(entry, modified) _http_match_last_modified_ex((entry), (modified), 1 TSRMLS_CC) +#define http_match_last_modified_ex(entry, modified, ep) _http_match_last_modified_ex((entry), (modified), (ep) TSRMLS_CC) +PHP_HTTP_API zend_bool _http_match_last_modified_ex(const char *entry, time_t t, zend_bool enforce_presence TSRMLS_DC); -#define http_etag_match(entry, etag) _http_etag_match_ex((entry), (etag), 1 TSRMLS_CC) -#define http_etag_match_ex(entry, etag, ep) _http_etag_match_ex((entry), (etag), (ep) TSRMLS_CC) -PHP_HTTP_API zend_bool _http_etag_match_ex(const char *entry, const char *etag, zend_bool enforce_presence TSRMLS_DC); +#define http_match_etag(entry, etag) _http_match_etag_ex((entry), (etag), 1 TSRMLS_CC) +#define http_match_etag_ex(entry, etag, ep) _http_match_etag_ex((entry), (etag), (ep) TSRMLS_CC) +PHP_HTTP_API zend_bool _http_match_etag_ex(const char *entry, const char *etag, zend_bool enforce_presence TSRMLS_DC); #define http_cache_last_modified(l, s, cc, ccl) _http_cache_last_modified((l), (s), (cc), (ccl) TSRMLS_CC) PHP_HTTP_API STATUS _http_cache_last_modified(time_t last_modified, time_t send_modified, const char *cache_control, size_t cc_len TSRMLS_DC); @@ -41,6 +41,9 @@ PHP_HTTP_API STATUS _http_cache_last_modified(time_t last_modified, time_t send_ #define http_cache_etag(e, el, cc, ccl) _http_cache_etag((e), (el), (cc), (ccl) TSRMLS_CC) PHP_HTTP_API STATUS _http_cache_etag(const char *etag, size_t etag_len, const char *cache_control, size_t cc_len TSRMLS_DC); +#define http_cache_exit() _http_cache_exit(TSRMLS_C) +PHP_HTTP_API STATUS _http_cache_exit(TSRMLS_D); + #endif /* diff --git a/tests/split_response_001.phpt b/tests/split_response_001.phpt index d67a7a8..799e23a 100644 --- a/tests/split_response_001.phpt +++ b/tests/split_response_001.phpt @@ -1,7 +1,7 @@ --TEST-- http_split_response() --SKIPIF-- - --FILE-- @@ -15,10 +15,10 @@ X-Powered-By: PHP/%s array ( 0 => array ( - 'Status' => '200 Ok', + 'Response Status' => '200 Ok', 'Content-Type' => 'text/plain', 'Content-Language' => 'de-AT', 'Date' => 'Sat, 22 Jan 2005 18:10:02 GMT', ), 1 => 'Hallo Du!', -) \ No newline at end of file +) -- 2.30.2