- ditch warnings
authorMichael Wallner <mike@php.net>
Thu, 25 Aug 2005 18:34:12 +0000 (18:34 +0000)
committerMichael Wallner <mike@php.net>
Thu, 25 Aug 2005 18:34:12 +0000 (18:34 +0000)
- fix PHP4 build, yet again
- http_message_parse() must check for Transfer-Encoding prior Content-Length

http.c
http_cache_api.c
http_functions.c
http_message_api.c
php_http_cache_api.h

diff --git a/http.c b/http.c
index e64840e3bbb8332990f207b2f5d13867f61486a2..2cd87113dee0122a0c962a6c1dbb0a8766546b8e 100644 (file)
--- 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);
 }
 
        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)
 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)
index 49843598a9425a03aed447ac7dd7cfe05915540b..6a86a80924c6abfcc1643b8a878e820a1ed312a3 100644 (file)
@@ -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)
 {
 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");
        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");
index 2bcdd212725188791493e1cccaa081844f05ba5e..a6542c2c31db4336fa79e722c44fe6298303b452 100644 (file)
@@ -1310,13 +1310,6 @@ PHP_FUNCTION(http_build_query)
 
 PHP_FUNCTION(http_test)
 {
 
 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));
-       }
 }
 
 /*
 }
 
 /*
index e399ed666a6e51a4c77bc41ae9f42151c72ea2ad..dbd92c8810a9156cd9c2a36b8f51555114794ac5 100644 (file)
@@ -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;
 
                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))) {
                /* 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
 
                        }
                } 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;
                /* message has content-range header */
                if (c = http_message_header(msg, "Content-Range")) {
                        ulong start = 0, end = 0;
index be59f5702c82317b8e29103d2a07f9b8de7b168b..b8120891239810c9136b9c2e79c308f17b25e311 100644 (file)
@@ -86,7 +86,7 @@ static inline void *_http_etag_init(TSRMLS_D)
                
 #ifdef HAVE_LIBMHASH
                default:
                
 #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;
                                http_error_ex(HE_ERROR, HE_RUNTIME, "Invalid ETag mode: %ld", mode);
                        }
                break;