- http_request_method_*() API should have been available even since last release...
[m6w6/ext-http] / http_functions.c
index 28d9be5571fbe45b3fc4ad309eebb8b858d3d17c..d3b81ea41cb9ffc44f1bafb274f0c9b4790111e7 100644 (file)
@@ -20,6 +20,8 @@
 #endif
 #include "php.h"
 
+#include "zend_operators.h"
+
 #include "SAPI.h"
 #include "php_ini.h"
 #include "ext/standard/info.h"
@@ -33,6 +35,7 @@
 #include "php_http_api.h"
 #include "php_http_request_api.h"
 #include "php_http_cache_api.h"
+#include "php_http_request_method_api.h"
 #include "php_http_request_api.h"
 #include "php_http_date_api.h"
 #include "php_http_headers_api.h"
@@ -407,7 +410,7 @@ PHP_FUNCTION(ob_etaghandler)
        }
 
        Z_TYPE_P(return_value) = IS_STRING;
-       http_ob_etaghandler(data, data_len, &Z_STRVAL_P(return_value), &Z_STRLEN_P(return_value), mode);
+       http_ob_etaghandler(data, data_len, &Z_STRVAL_P(return_value), (uint *) &Z_STRLEN_P(return_value), mode);
 }
 /* }}} */
 
@@ -614,14 +617,15 @@ PHP_FUNCTION(http_send_stream)
 PHP_FUNCTION(http_chunked_decode)
 {
        char *encoded = NULL, *decoded = NULL;
-       int encoded_len = 0, decoded_len = 0;
+       size_t decoded_len = 0;
+       int encoded_len = 0;
 
        if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &encoded, &encoded_len) != SUCCESS) {
                RETURN_FALSE;
        }
 
        if (NULL != http_chunked_decode(encoded, encoded_len, &decoded, &decoded_len)) {
-               RETURN_STRINGL(decoded, decoded_len, 0);
+               RETURN_STRINGL(decoded, (int) decoded_len, 0);
        } else {
                RETURN_FALSE;
        }
@@ -1045,6 +1049,8 @@ PHP_FUNCTION(http_put_stream)
        }
 }
 /* }}} */
+#endif /* HTTP_HAVE_CURL */
+/* }}} HAVE_CURL */
 
 /* {{{ proto long http_request_method_register(string method)
  *
@@ -1084,7 +1090,6 @@ PHP_FUNCTION(http_request_method_unregister)
                case IS_OBJECT:
                        convert_to_string(method);
                case IS_STRING:
-#include "zend_operators.h"
                        if (is_numeric_string(Z_STRVAL_P(method), Z_STRLEN_P(method), NULL, NULL, 1)) {
                                convert_to_long(method);
                        } else {
@@ -1152,8 +1157,6 @@ PHP_FUNCTION(http_request_method_name)
        }
 }
 /* }}} */
-#endif
-/* }}} HAVE_CURL */
 
 /* {{{ Sara Golemons http_build_query() */
 #ifndef ZEND_ENGINE_2