- move the chunked decoder to the encoding_api
[m6w6/ext-http] / http_functions.c
index b0916b9af403373bda564d06fd5b410bc30659db..364e81fe13c948eb9b6331afd1272a2f8212cb48 100644 (file)
@@ -42,6 +42,7 @@
 #include "php_http_message_api.h"
 #include "php_http_send_api.h"
 #include "php_http_url_api.h"
+#include "php_http_encoding_api.h"
 
 #include "phpstr/phpstr.h"
 
@@ -87,11 +88,11 @@ PHP_FUNCTION(http_date)
  * Returns the absolute URI as string.
  * 
  * Examples:
- * <code>
+ * <pre>
  * <?php
  * $uri = http_build_uri("page.php", "https", NULL, 488);
  * ?>
- * </code>
+ * </pre>
  */
 PHP_FUNCTION(http_build_uri)
 {
@@ -754,7 +755,7 @@ PHP_FUNCTION(http_chunked_decode)
                RETURN_FALSE;
        }
 
-       if (NULL != http_chunked_decode(encoded, encoded_len, &decoded, &decoded_len)) {
+       if (NULL != http_encoding_dechunk(encoded, encoded_len, &decoded, &decoded_len)) {
                RETURN_STRINGL(decoded, (int) decoded_len, 0);
        } else {
                RETURN_FALSE;
@@ -1254,7 +1255,7 @@ PHP_FUNCTION(http_put_stream)
 PHP_FUNCTION(http_request_method_register)
 {
        char *method;
-       int *method_len;
+       int method_len;
        unsigned long existing;
 
        if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &method, &method_len)) {
@@ -1264,7 +1265,7 @@ PHP_FUNCTION(http_request_method_register)
                RETURN_LONG((long) existing);
        }
 
-       RETVAL_LONG((long) http_request_method_register(method));
+       RETVAL_LONG((long) http_request_method_register(method, method_len));
 }
 /* }}} */
 
@@ -1307,7 +1308,7 @@ PHP_FUNCTION(http_request_method_unregister)
 }
 /* }}} */
 
-/* {{{ proto long http_request_method_exists(mixed method)
+/* {{{ proto int http_request_method_exists(mixed method)
  *
  * Check if a request method is registered (or available by default).
  *