update curl info
[m6w6/ext-http] / src / php_http_encoding.c
index 0aa7dc1638301b58bf66b46d4615e98e81ab6657..f5d634a105ac6a2dd046e679c57dafc72334920f 100644 (file)
@@ -64,7 +64,7 @@ const char *php_http_encoding_dechunk(const char *encoded, size_t encoded_len, c
                /* reached the end */
                if (!chunk_len) {
                        /* move over '0' chunked encoding terminator and any new lines */
-                       do {
+                       while(1) {
                                switch (*e_ptr) {
                                        case '0':
                                        case '\r':
@@ -72,7 +72,8 @@ const char *php_http_encoding_dechunk(const char *encoded, size_t encoded_len, c
                                                ++e_ptr;
                                                continue;
                                }
-                       } while (0);
+                               break;
+                       }
                        break;
                }
 
@@ -261,10 +262,9 @@ php_http_encoding_stream_t *php_http_encoding_stream_init(php_http_encoding_stre
 php_http_encoding_stream_t *php_http_encoding_stream_copy(php_http_encoding_stream_t *from, php_http_encoding_stream_t *to)
 {
        if (from->ops->copy) {
-               int freeme;
                php_http_encoding_stream_t *ns;
 
-               if ((freeme = !to)) {
+               if (!to) {
                        to = pemalloc(sizeof(*to), (from->flags & PHP_HTTP_ENCODING_STREAM_PERSISTENT));
                }
                memset(to, 0, sizeof(*to));
@@ -277,10 +277,6 @@ php_http_encoding_stream_t *php_http_encoding_stream_copy(php_http_encoding_stre
                } else {
                        return to;
                }
-
-               if (freeme) {
-                       pefree(to, (to->flags & PHP_HTTP_ENCODING_STREAM_PERSISTENT));
-               }
        }
 
        return NULL;
@@ -924,7 +920,7 @@ php_http_encoding_stream_object_t *php_http_encoding_stream_object_new_ex(zend_c
 
 zend_object *php_http_encoding_stream_object_clone(zval *object)
 {
-       php_http_encoding_stream_object_t *new_obj = NULL, *old_obj = PHP_HTTP_OBJ(NULL, object);
+       php_http_encoding_stream_object_t *new_obj, *old_obj = PHP_HTTP_OBJ(NULL, object);
        php_http_encoding_stream_t *cpy = php_http_encoding_stream_copy(old_obj->stream, NULL);
 
        new_obj = php_http_encoding_stream_object_new_ex(old_obj->zo.ce, cpy);