From: Michael Wallner Date: Thu, 25 Aug 2005 18:34:12 +0000 (+0000) Subject: - ditch warnings X-Git-Tag: RELEASE_0_12_0~8 X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-http;a=commitdiff_plain;h=1b093720ee0708c101a273e739ddb774f7d7f6d0 - ditch warnings - fix PHP4 build, yet again - http_message_parse() must check for Transfer-Encoding prior Content-Length --- diff --git a/http.c b/http.c index e64840e..2cd8711 100644 --- a/http.c +++ b/http.c @@ -186,6 +186,10 @@ PHP_INI_MH(http_update_allowed_methods) return OnUpdateString(entry, new_value, new_value_length, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC); } +#ifndef ZEND_ENGINE_2 +# define OnUpdateLong OnUpdateInt +#endif + PHP_INI_BEGIN() HTTP_PHP_INI_ENTRY("http.allowed_methods", "", PHP_INI_ALL, http_update_allowed_methods, request.methods.allowed) HTTP_PHP_INI_ENTRY("http.cache_log", "", PHP_INI_ALL, OnUpdateString, log.cache) diff --git a/http_cache_api.c b/http_cache_api.c index 4984359..6a86a80 100644 --- a/http_cache_api.c +++ b/http_cache_api.c @@ -202,9 +202,6 @@ PHP_HTTP_API STATUS _http_cache_etag(const char *etag, size_t etag_len, 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[41] = { 0 }; - unsigned char digest[20]; - if (mode & PHP_OUTPUT_HANDLER_START) { if (HTTP_G(etag).started) { http_error(HE_WARNING, HTTP_E_RUNTIME, "ob_etaghandler can only be used once"); diff --git a/http_functions.c b/http_functions.c index 2bcdd21..a6542c2 100644 --- a/http_functions.c +++ b/http_functions.c @@ -1310,13 +1310,6 @@ PHP_FUNCTION(http_build_query) PHP_FUNCTION(http_test) { - ulong idx; - char *key; - zval **data; - FOREACH_HASH_KEYVAL(&EG(symbol_table), key, idx, data) { - convert_to_string_ex(data); - fprintf(stderr, "\t %s => %s\n", key, Z_STRVAL_PP(data)); - } } /* diff --git a/http_message_api.c b/http_message_api.c index e399ed6..dbd92c8 100644 --- a/http_message_api.c +++ b/http_message_api.c @@ -150,13 +150,6 @@ PHP_HTTP_API http_message *_http_message_parse_ex(http_message *msg, const char zval *c; const char *continue_at = NULL; - /* message has content-length header */ - if (c = http_message_header(msg, "Content-Length")) { - long len = atol(Z_STRVAL_P(c)); - phpstr_from_string_ex(PHPSTR(msg), body, len); - continue_at = body + len; - } else - /* message has chunked transfer encoding */ if (c = http_message_header(msg, "Transfer-Encoding")) { if (!strcasecmp("chunked", Z_STRVAL_P(c))) { @@ -182,6 +175,13 @@ PHP_HTTP_API http_message *_http_message_parse_ex(http_message *msg, const char } } else + /* message has content-length header */ + if (c = http_message_header(msg, "Content-Length")) { + long len = atol(Z_STRVAL_P(c)); + phpstr_from_string_ex(PHPSTR(msg), body, len); + continue_at = body + len; + } else + /* message has content-range header */ if (c = http_message_header(msg, "Content-Range")) { ulong start = 0, end = 0; diff --git a/php_http_cache_api.h b/php_http_cache_api.h index be59f57..b812089 100644 --- a/php_http_cache_api.h +++ b/php_http_cache_api.h @@ -86,7 +86,7 @@ static inline void *_http_etag_init(TSRMLS_D) #ifdef HAVE_LIBMHASH default: - if ((mode < 0) || (mode > mhash_count()) || (!(ctx = mhash_init(mode)))) { + if ((mode < 0) || ((ulong)mode > mhash_count()) || (!(ctx = mhash_init(mode)))) { http_error_ex(HE_ERROR, HE_RUNTIME, "Invalid ETag mode: %ld", mode); } break;