- ditch some warnings
authorMichael Wallner <mike@php.net>
Tue, 15 Nov 2005 13:50:24 +0000 (13:50 +0000)
committerMichael Wallner <mike@php.net>
Tue, 15 Nov 2005 13:50:24 +0000 (13:50 +0000)
17 files changed:
http.c
http_api.c
http_cache_api.c
http_date_api.c
http_encoding_api.c
http_filter_api.c
http_functions.c
http_headers_api.c
http_message_api.c
http_message_object.c
http_request_api.c
http_request_object.c
http_request_pool_api.c
http_response_object.c
http_send_api.c
http_url_api.c
phpstr/phpstr.c

diff --git a/http.c b/http.c
index 244c423d92e59a2c170abd94b64b99f94acf1a93..38f91f829d9841c3002a5607217912758742e893 100644 (file)
--- a/http.c
+++ b/http.c
@@ -334,10 +334,9 @@ PHP_MSHUTDOWN_FUNCTION(http)
 /* {{{ PHP_RINIT_FUNCTION */
 PHP_RINIT_FUNCTION(http)
 {
-       char *m;
-
-       if (m = INI_STR("http.allowed_methods")) {
-               http_check_allowed_methods(m, strlen(m));
+       if (HTTP_G(request).methods.allowed) {
+               http_check_allowed_methods(HTTP_G(request).methods.allowed, 
+                       strlen(HTTP_G(request).methods.allowed));
        }
 
        http_globals_init(HTTP_GLOBALS);
index a78416a0bcb5bc73ff0c384cfac3530ae3d1e19c..2be27d0c79632b50722ecdaec6493b5bb781cda6 100644 (file)
@@ -88,7 +88,7 @@ char *_http_pretty_key(char *key, size_t key_len, zend_bool uctitle, zend_bool x
        if (key && key_len) {
                size_t i;
                int wasalpha;
-               if (wasalpha = isalpha((int) key[0])) {
+               if ((wasalpha = isalpha((int) key[0]))) {
                        key[0] = (char) (uctitle ? toupper((int) key[0]) : tolower((int) key[0]));
                }
                for (i = 1; i < key_len; i++) {
index 322c509d2f5a8873a526a1be104f6b7fc8a9768f..eb68044cb27b03e2ebc7157683cb62253b6866ee 100644 (file)
@@ -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));
index 1ebef701e7eed4a2155024c2600d1ff7bdfa0dc9..3872009157a5d1ea3ace49c0c1a981a32de92ab0 100644 (file)
@@ -147,7 +147,7 @@ PHP_HTTP_API char *_http_date(time_t t TSRMLS_DC)
 {
        struct tm *gmtime, tmbuf;
 
-       if (gmtime = php_gmtime_r(&t, &tmbuf)) {
+       if ((gmtime = php_gmtime_r(&t, &tmbuf))) {
                char *date = ecalloc(1, 31);
                snprintf(date, 30,
                        "%s, %02d %s %04d %02d:%02d:%02d GMT",
index eecbbab5dad9650ac4107fa37034c8d7e1ed5c3f..9475a176b86c47cf1ee653c581b1234faeb415af 100644 (file)
@@ -520,7 +520,7 @@ PHP_HTTP_API STATUS _http_encoding_stream_init(http_encoding_stream *s, int gzip
                HTTP_ENCODING_STREAM_ERROR(status, NULL);
        }
        
-       if (s->gzip = gzip) {
+       if ((s->gzip = gzip)) {
                s->crc = crc32(0L, Z_NULL, 0);
                *encoded_len = sizeof(http_encoding_gzip_header);
                *encoded = emalloc(*encoded_len);
@@ -622,7 +622,7 @@ PHP_HTTP_API zend_bool _http_encoding_response_start(size_t content_length TSRML
                        
                        HTTP_G(send).gzip_encoding = 0;
                        
-                       if (selected = http_negotiate_encoding(&zsupported)) {
+                       if ((selected = http_negotiate_encoding(&zsupported))) {
                                STATUS hs = FAILURE;
                                char *encoding = NULL;
                                ulong idx;
index ee42d608486e524523244da2ca2d5e83e1d66475..944bff241a8b7a31a06424b1ddc2dbe16eabb11f 100644 (file)
@@ -175,7 +175,7 @@ static HTTP_FILTER_FUNCTION(chunked_decode)
                                
                                /* we need eol, so we can be sure we have all hex digits */
                                phpstr_fix(PHPSTR(buffer));
-                               if (eolstr = http_locate_eol(PHPSTR_VAL(buffer), &eollen)) {
+                               if ((eolstr = http_locate_eol(PHPSTR_VAL(buffer), &eollen))) {
                                        char *stop = NULL;
                                        
                                        /* read in chunk size */
@@ -287,7 +287,7 @@ static php_stream_filter *http_filter_create(const char *name, zval *params, int
        if (!strcasecmp(name, "http.chunked_decode")) {
                http_filter_buffer *b = NULL;
                
-               if (b = pecalloc(1, sizeof(http_filter_buffer), p)) {
+               if ((b = pecalloc(1, sizeof(http_filter_buffer), p))) {
                        phpstr_init_ex(PHPSTR(b), 4096, p ? PHPSTR_INIT_PERSISTENT : 0);
                        if (!(f = php_stream_filter_alloc(&HTTP_FILTER_OP(chunked_decode), b, p))) {
                                pefree(b, p);
index 3ec05777fc273bbdacb68533fa97545a2403547c..9156ccc393187ce2a6fa5912059f75133efc6b83 100644 (file)
@@ -108,7 +108,7 @@ PHP_FUNCTION(http_build_uri)
 #define HTTP_DO_NEGOTIATE(type, supported, rs_array) \
 { \
        HashTable *result; \
-       if (result = http_negotiate_ ##type(supported)) { \
+       if ((result = http_negotiate_ ##type(supported))) { \
                char *key; \
                uint key_len; \
                ulong idx; \
@@ -447,7 +447,7 @@ PHP_FUNCTION(http_cache_last_modified)
        /* 0 or omitted */
        if (!last_modified) {
                /* does the client have? (att: caching "forever") */
-               if (zlm = http_get_server_var("HTTP_IF_MODIFIED_SINCE")) {
+               if ((zlm = http_get_server_var("HTTP_IF_MODIFIED_SINCE"))) {
                        last_modified = send_modified = http_parse_date(Z_STRVAL_P(zlm));
                /* send current time */
                } else {
@@ -817,7 +817,7 @@ PHP_FUNCTION(http_parse_message)
                RETURN_NULL();
        }
        
-       if (msg = http_message_parse(message, message_len)) {
+       if ((msg = http_message_parse(message, message_len))) {
                object_init(return_value);
                http_message_tostruct_recursive(msg, return_value);
                http_message_free(&msg);
@@ -1269,7 +1269,7 @@ PHP_FUNCTION(http_request_method_register)
        if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &method, &method_len)) {
                RETURN_FALSE;
        }
-       if (existing = http_request_method_exists(1, 0, method)) {
+       if ((existing = http_request_method_exists(1, 0, method))) {
                RETURN_LONG((long) existing);
        }
 
index 4c3c5025aa67d27f21665ca8b51953859d3e4589..c4d23c8a17824d1d172d88a033f74f4769dbf106 100644 (file)
@@ -82,7 +82,7 @@ char *_http_negotiate_language_func(const char *test, double *quality, HashTable
        }
        
        /* no distinct match found, so try primaries */
-       if (dash_test = strchr(test, '-')) {
+       if ((dash_test = strchr(test, '-'))) {
                FOREACH_HASH_VAL(pos, supported, value) {
                        int len = dash_test - test;
 #if HTTP_DBG_NEG
@@ -161,7 +161,7 @@ PHP_HTTP_API HashTable *_http_negotiate_q(const char *header, HashTable *support
                                fprintf(stderr, "Checking %s\n", Z_STRVAL_PP(entry));
 #endif
                                
-                               if (separator = strchr(Z_STRVAL_PP(entry), ';')) {
+                               if ((separator = strchr(Z_STRVAL_PP(entry), ';'))) {
                                        const char *ptr = separator;
                                        
                                        while (*++ptr && !isdigit(*ptr));
@@ -173,7 +173,7 @@ PHP_HTTP_API HashTable *_http_negotiate_q(const char *header, HashTable *support
                                        identifier = estrndup(Z_STRVAL_PP(entry), Z_STRLEN_PP(entry));
                                }
                                
-                               if (selected = neg(identifier, &quality, supported TSRMLS_CC)) {
+                               if ((selected = neg(identifier, &quality, supported TSRMLS_CC))) {
                                        /* don't overwrite previously set with higher quality */
                                        if (!zend_hash_exists(Z_ARRVAL(array), selected, strlen(selected) + 1)) {
                                                add_assoc_double(&array, selected, quality);
index d175201913996af652c287015b218d1de52c1842..77f18e017c25aea336472b50aa50217fd7e10fde 100644 (file)
@@ -144,7 +144,7 @@ PHP_HTTP_API http_message *_http_message_parse_ex(http_message *msg, const char
        }
 
        /* header parsing stops at (CR)LF (CR)LF */
-       if (body = http_locate_body(message)) {
+       if ((body = http_locate_body(message))) {
                zval *c;
                const char *continue_at = NULL;
                size_t remaining = message + message_length - body;
@@ -155,7 +155,7 @@ PHP_HTTP_API http_message *_http_message_parse_ex(http_message *msg, const char
                        size_t decoded_len;
 
                        /* decode and replace Transfer-Encoding with Content-Length header */
-                       if (continue_at = http_encoding_dechunk(body, message + message_length - body, &decoded, &decoded_len)) {
+                       if ((continue_at = http_encoding_dechunk(body, message + message_length - body, &decoded, &decoded_len))) {
                                zval *len;
                                char *tmp;
                                int tmp_len;
@@ -174,7 +174,7 @@ 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")) {
+               if ((c = http_message_header(msg, "Content-Length"))) {
                        ulong len = strtoul(Z_STRVAL_P(c), NULL, 10);
                        if (len > remaining) {
                                http_error_ex(HE_NOTICE, HTTP_E_MALFORMED_HEADERS, "The Content-Length header pretends a larger body than actually received (expected %lu bytes; got %lu bytes)", len, remaining);
@@ -185,7 +185,7 @@ PHP_HTTP_API http_message *_http_message_parse_ex(http_message *msg, const char
                } else
 
                /* message has content-range header */
-               if (c = http_message_header(msg, "Content-Range")) {
+               if ((c = http_message_header(msg, "Content-Range"))) {
                        ulong total = 0, start = 0, end = 0, len = 0;
                        
                        if (!strncasecmp(Z_STRVAL_P(c), "bytes", lenof("bytes")) && 
@@ -224,7 +224,7 @@ PHP_HTTP_API http_message *_http_message_parse_ex(http_message *msg, const char
                
 #if defined(HTTP_HAVE_ZLIB) || defined(HAVE_ZLIB)
                /* check for compressed data */
-               if (c = http_message_header(msg, "Content-Encoding")) {
+               if ((c = http_message_header(msg, "Content-Encoding"))) {
                        char *decoded = NULL;
                        size_t decoded_len = 0;
 #      if defined(HAVE_ZLIB) && !defined(HTTP_HAVE_ZLIB)
@@ -288,7 +288,7 @@ PHP_HTTP_API http_message *_http_message_parse_ex(http_message *msg, const char
                                http_message *next = NULL, *most = NULL;
 
                                /* set current message to parent of most parent following messages and return deepest */
-                               if (most = next = http_message_parse(continue_at, message + message_length - continue_at)) {
+                               if ((most = next = http_message_parse(continue_at, message + message_length - continue_at))) {
                                        while (most->parent) most = most->parent;
                                        most->parent = msg;
                                        msg = next;
@@ -382,7 +382,7 @@ PHP_HTTP_API void _http_message_serialize(http_message *message, char **string,
                http_message_tostring(message, &buf, &len);
                phpstr_prepend(&str, buf, len);
                efree(buf);
-       } while (message = message->parent);
+       } while ((message = message->parent));
 
        buf = phpstr_data(&str, string, length);
        if (!string) {
@@ -412,6 +412,10 @@ PHP_HTTP_API void _http_message_tostruct_recursive(http_message *msg, zval *obj
                        add_assoc_string(&strct, "requestMethod", msg->http.info.request.method, 1);
                        add_assoc_string(&strct, "requestUri", msg->http.info.request.URI, 1);
                break;
+               
+               case HTTP_MSG_NONE:
+                       /* avoid compiler warning */
+               break;
        }
        
        MAKE_STD_ZVAL(headers);
@@ -493,7 +497,7 @@ PHP_HTTP_API STATUS _http_message_send(http_message *message TSRMLS_DC)
                                int port = 0;
 
                                /* check for port */
-                               if (colon = strchr(Z_STRVAL_PP(zhost), ':')) {
+                               if ((colon = strchr(Z_STRVAL_PP(zhost), ':'))) {
                                        port = atoi(colon + 1);
                                        host = estrndup(Z_STRVAL_PP(zhost), host_len = (Z_STRVAL_PP(zhost) - colon - 1));
                                } else {
index bd15becf2e3e62747989e1fff4c7640597a2acc2..fbe5fc2919d7f7784b18ce31ba55814ff5c0c743 100644 (file)
@@ -554,7 +554,7 @@ PHP_METHOD(HttpMessage, __construct)
                http_message *msg = obj->message;
                
                http_message_dtor(msg);
-               if (obj->message = http_message_parse_ex(msg, message, length)) {
+               if ((obj->message = http_message_parse_ex(msg, message, length))) {
                        if (obj->message->parent) {
                                obj->parent = http_message_object_new_ex(Z_OBJCE_P(getThis()), obj->message->parent, NULL);
                        }
@@ -590,7 +590,7 @@ PHP_METHOD(HttpMessage, fromString)
        
        SET_EH_THROW_HTTP();
        if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &string, &length)) {
-               if (msg = http_message_parse(string, length)) {
+               if ((msg = http_message_parse(string, length))) {
                        ZVAL_OBJVAL(return_value, http_message_object_new_ex(http_message_object_ce, msg, NULL));
                }
        }
index d94e558ec1593e04798869f82f22d3130d856fac..496a63ed8d4e735cf057dfaf5ac2307b6323877b 100644 (file)
@@ -426,47 +426,47 @@ PHP_HTTP_API STATUS _http_request_init(CURL *ch, http_request_method meth, char
 #endif
 
        /* progress callback */
-       if (zoption = http_curl_getopt(options, "onprogress", 0)) {
+       if ((zoption = http_curl_getopt(options, "onprogress", 0))) {
                HTTP_CURL_OPT(NOPROGRESS, 0);
                HTTP_CURL_OPT(PROGRESSFUNCTION, http_curl_progress_callback);
                HTTP_CURL_OPT(PROGRESSDATA,  http_request_callback_data(zoption));
        }
 
        /* proxy */
-       if (zoption = http_curl_getopt(options, "proxyhost", IS_STRING)) {
+       if ((zoption = http_curl_getopt(options, "proxyhost", IS_STRING))) {
                HTTP_CURL_OPT(PROXY, http_request_data_copy(COPY_STRING, Z_STRVAL_P(zoption)));
                /* port */
-               if (zoption = http_curl_getopt(options, "proxyport", IS_LONG)) {
+               if ((zoption = http_curl_getopt(options, "proxyport", IS_LONG))) {
                        HTTP_CURL_OPT(PROXYPORT, Z_LVAL_P(zoption));
                }
                /* user:pass */
-               if (zoption = http_curl_getopt(options, "proxyauth", IS_STRING)) {
+               if ((zoption = http_curl_getopt(options, "proxyauth", IS_STRING))) {
                        HTTP_CURL_OPT(PROXYUSERPWD, http_request_data_copy(COPY_STRING, Z_STRVAL_P(zoption)));
                }
 #if LIBCURL_VERSION_NUM >= 0x070a07
                /* auth method */
-               if (zoption = http_curl_getopt(options, "proxyauthtype", IS_LONG)) {
+               if ((zoption = http_curl_getopt(options, "proxyauthtype", IS_LONG))) {
                        HTTP_CURL_OPT(PROXYAUTH, Z_LVAL_P(zoption));
                }
 #endif
        }
 
        /* outgoing interface */
-       if (zoption = http_curl_getopt(options, "interface", IS_STRING)) {
+       if ((zoption = http_curl_getopt(options, "interface", IS_STRING))) {
                HTTP_CURL_OPT(INTERFACE, http_request_data_copy(COPY_STRING, Z_STRVAL_P(zoption)));
        }
 
        /* another port */
-       if (zoption = http_curl_getopt(options, "port", IS_LONG)) {
+       if ((zoption = http_curl_getopt(options, "port", IS_LONG))) {
                HTTP_CURL_OPT(PORT, Z_LVAL_P(zoption));
        }
 
        /* auth */
-       if (zoption = http_curl_getopt(options, "httpauth", IS_STRING)) {
+       if ((zoption = http_curl_getopt(options, "httpauth", IS_STRING))) {
                HTTP_CURL_OPT(USERPWD, http_request_data_copy(COPY_STRING, Z_STRVAL_P(zoption)));
        }
 #if LIBCURL_VERSION_NUM >= 0x070a06
-       if (zoption = http_curl_getopt(options, "httpauthtype", IS_LONG)) {
+       if ((zoption = http_curl_getopt(options, "httpauthtype", IS_LONG))) {
                HTTP_CURL_OPT(HTTPAUTH, Z_LVAL_P(zoption));
        }
 #endif
@@ -481,26 +481,26 @@ PHP_HTTP_API STATUS _http_request_init(CURL *ch, http_request_method meth, char
        }
 
        /* redirects, defaults to 0 */
-       if (zoption = http_curl_getopt(options, "redirect", IS_LONG)) {
+       if ((zoption = http_curl_getopt(options, "redirect", IS_LONG))) {
                HTTP_CURL_OPT(FOLLOWLOCATION, Z_LVAL_P(zoption) ? 1 : 0);
                HTTP_CURL_OPT(MAXREDIRS, Z_LVAL_P(zoption));
-               if (zoption = http_curl_getopt(options, "unrestrictedauth", IS_BOOL)) {
+               if ((zoption = http_curl_getopt(options, "unrestrictedauth", IS_BOOL))) {
                        HTTP_CURL_OPT(UNRESTRICTED_AUTH, Z_LVAL_P(zoption));
                }
        }
 
        /* referer */
-       if (zoption = http_curl_getopt(options, "referer", IS_STRING)) {
+       if ((zoption = http_curl_getopt(options, "referer", IS_STRING))) {
                HTTP_CURL_OPT(REFERER, http_request_data_copy(COPY_STRING, Z_STRVAL_P(zoption)));
        }
 
        /* useragent, default "PECL::HTTP/version (PHP/version)" */
-       if (zoption = http_curl_getopt(options, "useragent", IS_STRING)) {
+       if ((zoption = http_curl_getopt(options, "useragent", IS_STRING))) {
                HTTP_CURL_OPT(USERAGENT, http_request_data_copy(COPY_STRING, Z_STRVAL_P(zoption)));
        }
 
        /* additional headers, array('name' => 'value') */
-       if (zoption = http_curl_getopt(options, "headers", IS_ARRAY)) {
+       if ((zoption = http_curl_getopt(options, "headers", IS_ARRAY))) {
                char *header_key;
                ulong header_idx;
                HashPosition pos;
@@ -526,7 +526,7 @@ PHP_HTTP_API STATUS _http_request_init(CURL *ch, http_request_method meth, char
        }
 
        /* cookies, array('name' => 'value') */
-       if (zoption = http_curl_getopt(options, "cookies", IS_ARRAY)) {
+       if ((zoption = http_curl_getopt(options, "cookies", IS_ARRAY))) {
                char *cookie_key = NULL;
                ulong cookie_idx = 0;
                HashPosition pos;
@@ -552,7 +552,7 @@ PHP_HTTP_API STATUS _http_request_init(CURL *ch, http_request_method meth, char
        }
 
        /* session cookies */
-       if (zoption = http_curl_getopt(options, "cookiesession", IS_BOOL)) {
+       if ((zoption = http_curl_getopt(options, "cookiesession", IS_BOOL))) {
                if (Z_LVAL_P(zoption)) {
                        /* accept cookies for this session */
                        HTTP_CURL_OPT(COOKIEFILE, "");
@@ -575,12 +575,12 @@ PHP_HTTP_API STATUS _http_request_init(CURL *ch, http_request_method meth, char
        }
 
        /* maxfilesize */
-       if (zoption = http_curl_getopt(options, "maxfilesize", IS_LONG)) {
+       if ((zoption = http_curl_getopt(options, "maxfilesize", IS_LONG))) {
                HTTP_CURL_OPT(MAXFILESIZE, Z_LVAL_P(zoption));
        }
 
        /* lastmodified */
-       if (zoption = http_curl_getopt(options, "lastmodified", IS_LONG)) {
+       if ((zoption = http_curl_getopt(options, "lastmodified", IS_LONG))) {
                if (Z_LVAL_P(zoption)) {
                        if (Z_LVAL_P(zoption) > 0) {
                                HTTP_CURL_OPT(TIMEVALUE, Z_LVAL_P(zoption));
@@ -594,17 +594,17 @@ PHP_HTTP_API STATUS _http_request_init(CURL *ch, http_request_method meth, char
        }
 
        /* timeout, defaults to 0 */
-       if (zoption = http_curl_getopt(options, "timeout", IS_LONG)) {
+       if ((zoption = http_curl_getopt(options, "timeout", IS_LONG))) {
                HTTP_CURL_OPT(TIMEOUT, Z_LVAL_P(zoption));
        }
 
        /* connecttimeout, defaults to 3 */
-       if (zoption = http_curl_getopt(options, "connecttimeout", IS_LONG)) {
+       if ((zoption = http_curl_getopt(options, "connecttimeout", IS_LONG))) {
                HTTP_CURL_OPT(CONNECTTIMEOUT, Z_LVAL_P(zoption));
        }
 
        /* ssl */
-       if (zoption = http_curl_getopt(options, "ssl", IS_ARRAY)) {
+       if ((zoption = http_curl_getopt(options, "ssl", IS_ARRAY))) {
                ulong idx;
                char *key = NULL;
                zval **param;
@@ -629,7 +629,6 @@ PHP_HTTP_API STATUS _http_request_init(CURL *ch, http_request_method meth, char
                                HTTP_CURL_OPT_SSL_LONG_(VERIFYHOST);
                                HTTP_CURL_OPT_SSL_STRING_(CIPHER_LIST);
 
-
                                HTTP_CURL_OPT_STRING(CAINFO);
 #if LIBCURL_VERSION_NUM >= 0x070908
                                HTTP_CURL_OPT_STRING(CAPATH);
@@ -866,8 +865,8 @@ static int http_curl_raw_callback(CURL *ch, curl_infotype type, char *data, size
                                phpstr_append(conv->request, data, length);
                        }
                break;
-#if 0
                default:
+#if 0
                        fprintf(stderr, "## ", type);
                        if (!type) {
                                fprintf(stderr, "%s", data);
@@ -884,8 +883,8 @@ static int http_curl_raw_callback(CURL *ch, curl_infotype type, char *data, size
                        if (data[length-1] != 0xa) {
                                fprintf(stderr, "\n");
                        }
-               break;
 #endif
+               break;
        }
 
        if (type) {
index 2ed979789b009c8a93b2c983baca769b5a50a946..43cf5a805ea0660905d66367f33493d81711383f 100644 (file)
@@ -1894,7 +1894,7 @@ PHP_METHOD(HttpRequest, getRequestMessage)
                getObject(http_request_object, obj);
 
                SET_EH_THROW_HTTP();
-               if (msg = http_message_parse(PHPSTR_VAL(&obj->request), PHPSTR_LEN(&obj->request))) {
+               if ((msg = http_message_parse(PHPSTR_VAL(&obj->request), PHPSTR_LEN(&obj->request)))) {
                        ZVAL_OBJVAL(return_value, http_message_object_new_ex(http_message_object_ce, msg, NULL));
                }
                SET_EH_NORMAL();
@@ -1930,7 +1930,7 @@ PHP_METHOD(HttpRequest, getHistory)
                getObject(http_request_object, obj);
 
                SET_EH_THROW_HTTP();
-               if (msg = http_message_parse(PHPSTR_VAL(&obj->history), PHPSTR_LEN(&obj->history))) {
+               if ((msg = http_message_parse(PHPSTR_VAL(&obj->history), PHPSTR_LEN(&obj->history)))) {
                        ZVAL_OBJVAL(return_value, http_message_object_new_ex(http_message_object_ce, msg, NULL));
                }
                SET_EH_NORMAL();
index 9abbc3a76bb3ec1fe87b7b1faa1a2b5a448bcd83..c221f1ea0747ffe6a40e58309a4d4849b35e49fd 100644 (file)
@@ -269,7 +269,7 @@ PHP_HTTP_API int _http_request_pool_perform(http_request_pool *pool TSRMLS_DC)
        
        while (CURLM_CALL_MULTI_PERFORM == curl_multi_perform(pool->ch, &pool->unfinished));
        
-       while (msg = curl_multi_info_read(pool->ch, &remaining)) {
+       while ((msg = curl_multi_info_read(pool->ch, &remaining))) {
                if (CURLMSG_DONE == msg->msg) {
                        if (CURLE_OK != msg->data.result) {
                                http_error(HE_WARNING, HTTP_E_REQUEST, curl_easy_strerror(msg->data.result));
index a0b8817cc218563e95fc758e23af0a826da952eb..e5b0d00da8c4366a72be0614973e4604879053d8 100644 (file)
@@ -900,7 +900,7 @@ PHP_METHOD(HttpResponse, setData)
        }
        
        UPD_STATIC_PROP(long, lastModified, http_last_modified(the_data, SEND_DATA));
-       if (etag = http_etag(Z_STRVAL_P(the_data), Z_STRLEN_P(the_data), SEND_DATA)) {
+       if ((etag = http_etag(Z_STRVAL_P(the_data), Z_STRLEN_P(the_data), SEND_DATA))) {
                UPD_STATIC_PROP(string, eTag, etag);
                efree(etag);
        }
@@ -959,7 +959,7 @@ PHP_METHOD(HttpResponse, setStream)
        zend_list_addref(Z_LVAL_P(the_stream));
        
        UPD_STATIC_PROP(long, lastModified, http_last_modified(the_real_stream, SEND_RSRC));
-       if (etag = http_etag(the_real_stream, 0, SEND_RSRC)) {
+       if ((etag = http_etag(the_real_stream, 0, SEND_RSRC))) {
                UPD_STATIC_PROP(string, eTag, etag);
                efree(etag);
        }
@@ -1018,7 +1018,7 @@ PHP_METHOD(HttpResponse, setFile)
        }
 
        UPD_STATIC_PROP(long, lastModified, http_last_modified(the_file, -1));
-       if (etag = http_etag(the_file, 0, -1)) {
+       if ((etag = http_etag(the_file, 0, -1))) {
                UPD_STATIC_PROP(string, eTag, etag);
                efree(etag);
        }
index dfd0643eb13acc9ab303329ef56a4ed52fd643cc..d432b5cf65987974806c9c38be4266d1e9dce64f 100644 (file)
@@ -313,14 +313,14 @@ PHP_HTTP_API STATUS _http_send_ex(const void *data_ptr, size_t data_size, http_s
        zend_hash_init(&ranges, 0, NULL, ZVAL_PTR_DTOR, 0);
        range_status = http_get_request_ranges(&ranges, data_size);
 
-       if (range_status == RANGE_ERR) {
-               zend_hash_destroy(&ranges);
-               http_send_status(416);
-               return FAILURE;
-       }
-       
        switch (range_status)
        {
+               case RANGE_ERR:
+               {
+                       zend_hash_destroy(&ranges);
+                       http_send_status(416);
+                       return FAILURE;
+               }
                case RANGE_OK:
                {
                        /* Range Request - only send ranges if entity hasn't changed */
@@ -400,7 +400,7 @@ PHP_HTTP_API STATUS _http_send_ex(const void *data_ptr, size_t data_size, http_s
                        if (!no_cache && cache_etag) {
                                char *etag = NULL;
                                
-                               if (etag = http_etag(data_ptr, data_size, data_mode)) {
+                               if ((etag = http_etag(data_ptr, data_size, data_mode))) {
                                        char *sent_header = NULL;
                                        
                                        http_send_etag_ex(etag, strlen(etag), &sent_header);
index dd7066085d514e010937b7b88d5fa5d1b67f21bb..9c35a5c4a989f906191c929ad522cbf865429db6 100644 (file)
@@ -90,7 +90,7 @@ PHP_HTTP_API char *_http_absolute_url_ex(
                furl.port = purl->port;
        } else if (strncmp(furl.scheme, "http", 4)) {
 #if defined(PHP_WIN32) || defined(HAVE_NETDB_H)
-               if (se = getservbyname(furl.scheme, "tcp")) {
+               if ((se = getservbyname(furl.scheme, "tcp"))) {
                        furl.port = se->s_port;
                }
 #endif
index 69f577f2da079cf1221db19c90188b215063f7e4..8ab8737d0d68e424426eda5ec1b75f12155de096 100644 (file)
@@ -25,7 +25,7 @@ PHPSTR_API phpstr *phpstr_init_ex(phpstr *buf, size_t chunk_size, int flags)
 
 PHPSTR_API phpstr *phpstr_from_string_ex(phpstr *buf, const char *string, size_t length)
 {
-       if (buf = phpstr_init(buf)) {
+       if ((buf = phpstr_init(buf))) {
                if (NOMEM == phpstr_append(buf, string, length)) {
                        pefree(buf, buf->pmem);
                        buf = NULL;
@@ -346,7 +346,7 @@ PHPSTR_API void phpstr_chunked_output(phpstr **s, const char *data, size_t data_
        char *chunk = NULL;
        size_t got = 0;
        
-       while (got = phpstr_chunk_buffer(s, data, data_len, &chunk, chunk_len)) {
+       while ((got = phpstr_chunk_buffer(s, data, data_len, &chunk, chunk_len))) {
                passthru(chunk, got TSRMLS_CC);
                if (!chunk_len) {
                        /*      we already got the last chunk,