X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-http;a=blobdiff_plain;f=http_cache_api.c;h=eb68044cb27b03e2ebc7157683cb62253b6866ee;hp=11609f989fee4132832bc67c7144ff08ee569e13;hb=a0bca521b491711e43aef74fe19c23a8eb4d0777;hpb=e83a7438dc70ed96630887246a1d3aefcf155b1c diff --git a/http_cache_api.c b/http_cache_api.c index 11609f9..eb68044 100644 --- a/http_cache_api.c +++ b/http_cache_api.c @@ -120,7 +120,7 @@ PHP_HTTP_API zend_bool _http_match_last_modified_ex(const char *entry, time_t t, HTTP_GSC(zmodified, entry, !enforce_presence); modified = estrndup(Z_STRVAL_P(zmodified), Z_STRLEN_P(zmodified)); - if (chr_ptr = strrchr(modified, ';')) { + if ((chr_ptr = strrchr(modified, ';'))) { chr_ptr = 0; } retval = (t <= http_parse_date(modified)); @@ -160,6 +160,10 @@ PHP_HTTP_API STATUS _http_cache_last_modified(time_t last_modified, { char *sent_header = NULL; + if (SG(headers_sent)) { + return FAILURE; + } + if (cc_len && (SUCCESS != http_send_cache_control(cache_control, cc_len))) { return FAILURE; } @@ -184,6 +188,10 @@ PHP_HTTP_API STATUS _http_cache_etag(const char *etag, size_t etag_len, { char *sent_header = NULL; + if (SG(headers_sent)) { + return FAILURE; + } + if (cc_len && (SUCCESS != http_send_cache_control(cache_control, cc_len))) { return FAILURE; }