- SPL doesn't install its headers
[m6w6/ext-http] / http_send_api.c
index 6ab4a2f2f3e1010267d6df019c830188b72d2a2e..badfaf702c20e3c7820dc16b570951ed404ae741 100644 (file)
@@ -348,6 +348,7 @@ PHP_HTTP_API STATUS _http_send_ex(const void *data_ptr, size_t data_size, http_s
                                        }
                                } else {
                                        /* multi range */
+                                       HashPosition pos;
                                        zval **range, **begin, **end;
                                        const char *content_type = HTTP_G(send).content_type;
                                        char boundary_str[32], range_header_str[256];
@@ -363,7 +364,7 @@ PHP_HTTP_API STATUS _http_send_ex(const void *data_ptr, size_t data_size, http_s
                                                content_type = "application/x-octetstream";
                                        }
                                        
-                                       FOREACH_HASH_VAL(&ranges, range) {
+                                       FOREACH_HASH_VAL(pos, &ranges, range) {
                                                if (    SUCCESS == zend_hash_index_find(Z_ARRVAL_PP(range), 0, (void **) &begin) &&
                                                                SUCCESS == zend_hash_index_find(Z_ARRVAL_PP(range), 1, (void **) &end)) {
                                                        char preface_str[512];
@@ -372,7 +373,7 @@ PHP_HTTP_API STATUS _http_send_ex(const void *data_ptr, size_t data_size, http_s
 #define HTTP_RANGE_PREFACE \
        HTTP_CRLF "--%s" \
        HTTP_CRLF "Content-Type: %s" \
-       HTTP_CRLF "Content-Range: bytes %ld-%ld/%lu" \
+       HTTP_CRLF "Content-Range: bytes %ld-%ld/%zu" \
        HTTP_CRLF HTTP_CRLF
                                                        
                                                        preface_len = snprintf(preface_str, lenof(preface_str), HTTP_RANGE_PREFACE, boundary_str, content_type, Z_LVAL_PP(begin), Z_LVAL_PP(end), data_size);