From 9287fdda2887622c8fe69f7b63d6803d60827ded Mon Sep 17 00:00:00 2001 From: Michael Wallner Date: Tue, 27 Dec 2005 15:30:11 +0000 Subject: [PATCH] - add missing constants to HttpDeflateStream - add parse_url errors --- http_deflatestream_object.c | 5 +++++ http_functions.c | 6 +++--- http_url_api.c | 2 ++ 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/http_deflatestream_object.c b/http_deflatestream_object.c index f4e5532..d5813f9 100644 --- a/http_deflatestream_object.c +++ b/http_deflatestream_object.c @@ -122,6 +122,11 @@ static inline void _http_deflatestream_object_declare_default_properties(TSRMLS_ DCL_CONST(long, "LEVEL_DEF", HTTP_DEFLATE_LEVEL_DEF); DCL_CONST(long, "LEVEL_MIN", HTTP_DEFLATE_LEVEL_MIN); DCL_CONST(long, "LEVEL_MAX", HTTP_DEFLATE_LEVEL_MAX); + DCL_CONST(long, "STRATEGY_DEF", HTTP_DEFLATE_STRATEGY_DEF); + DCL_CONST(long, "STRATEGY_FILT", HTTP_DEFLATE_STRATEGY_FILT); + DCL_CONST(long, "STRATEGY_HUFF", HTTP_DEFLATE_STRATEGY_HUFF); + DCL_CONST(long, "STRATEGY_RLE", HTTP_DEFLATE_STRATEGY_RLE); + DCL_CONST(long, "STRATEGY_FIXED", HTTP_DEFLATE_STRATEGY_FIXED); #endif } diff --git a/http_functions.c b/http_functions.c index 41afd28..7f7c4d6 100644 --- a/http_functions.c +++ b/http_functions.c @@ -66,7 +66,7 @@ PHP_FUNCTION(http_date) } /* }}} */ -/* {{{ proto string http_build_url(mixed url[, mixed parts[, array new_url]]) +/* {{{ proto string http_build_url(mixed url[, mixed parts[, array &new_url]]) * * Returns the new URL as string on success or FALSE on failure. */ @@ -87,6 +87,7 @@ PHP_FUNCTION(http_build_url) } else { convert_to_string(z_new_url); if (!(new_url = php_url_parse_ex(Z_STRVAL_P(z_new_url), Z_STRLEN_P(z_new_url)))) { + http_error_ex(HE_WARNING, HTTP_E_URL, "Could not parse URL (%s)", Z_STRVAL_P(z_new_url)); RETURN_FALSE; } } @@ -100,6 +101,7 @@ PHP_FUNCTION(http_build_url) if (new_url) { php_url_free(new_url); } + http_error_ex(HE_WARNING, HTTP_E_URL, "Could not parse URL (%s)", Z_STRVAL_P(z_old_url)); RETURN_FALSE; } } @@ -601,8 +603,6 @@ PHP_FUNCTION(ob_etaghandler) * Provides a basic throttling mechanism, which will yield the current process * resp. thread until the entity has been completely sent, though. * - * Note: This doesn't really work with the FastCGI SAPI. - * * Expects a double parameter specifying the seconds too sleep() after * each chunk sent. Additionally accepts an optional int parameter * representing the chunk size in bytes. diff --git a/http_url_api.c b/http_url_api.c index 53faf95..2fde306 100644 --- a/http_url_api.c +++ b/http_url_api.c @@ -37,6 +37,8 @@ PHP_HTTP_API char *_http_absolute_url(const char *url TSRMLS_DC) if (purl) { http_build_url(purl, NULL, NULL, &abs, NULL); php_url_free(purl); + } else { + http_error_ex(HE_WARNING, HTTP_E_URL, "Could not parse URL (%s)", url); } return abs; -- 2.30.2