X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-http;a=blobdiff_plain;f=http_cache_api.c;h=322c509d2f5a8873a526a1be104f6b7fc8a9768f;hp=dcc833ed9f4ed93e00a66cb50e6fde6c5f6822a1;hb=391c85f10c017e1e4de656b051c1bba009ede7b3;hpb=e103c61ca14d22e9507379810e980075c8323ca3 diff --git a/http_cache_api.c b/http_cache_api.c index dcc833e..322c509 100644 --- a/http_cache_api.c +++ b/http_cache_api.c @@ -1,16 +1,13 @@ /* - +----------------------------------------------------------------------+ - | PECL :: http | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.0 of the PHP license, that | - | is bundled with this package in the file LICENSE, and is available | - | through the world-wide-web at http://www.php.net/license/3_0.txt. | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Copyright (c) 2004-2005 Michael Wallner | - +----------------------------------------------------------------------+ + +--------------------------------------------------------------------+ + | PECL :: http | + +--------------------------------------------------------------------+ + | Redistribution and use in source and binary forms, with or without | + | modification, are permitted provided that the conditions mentioned | + | in the accompanying LICENSE file are met. | + +--------------------------------------------------------------------+ + | Copyright (c) 2004-2005, Michael Wallner | + +--------------------------------------------------------------------+ */ /* $Id$ */ @@ -163,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; } @@ -187,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; }