- rename http_absolute_uri to http_build_uri (complements http_build_query)
authorMichael Wallner <mike@php.net>
Tue, 4 Oct 2005 14:34:26 +0000 (14:34 +0000)
committerMichael Wallner <mike@php.net>
Tue, 4 Oct 2005 14:34:26 +0000 (14:34 +0000)
- ditch memleak in the HTTP_DO_NEGOTIATE() macro

http.c
http_functions.c
http_util_object.c
php_http.h

diff --git a/http.c b/http.c
index f7f0f31e25c850c0330ebcb243ef631406849e51..2402ccba6b7fd761c9ac943106306833f38c5430 100644 (file)
--- a/http.c
+++ b/http.c
@@ -75,7 +75,8 @@ ZEND_GET_MODULE(http)
 zend_function_entry http_functions[] = {
        PHP_FE(http_test, NULL)
        PHP_FE(http_date, NULL)
-       PHP_FE(http_absolute_uri, NULL)
+       PHP_FE(http_build_uri, NULL)
+       PHP_FALIAS(http_absolute_uri, http_build_uri, NULL)
        PHP_FE(http_negotiate_language, NULL)
        PHP_FE(http_negotiate_charset, NULL)
        PHP_FE(http_redirect, NULL)
index 7d7eec4b2a05365c2e9fe79cbcecadaf20395c2b..9265d2252214875a159a706d1a888440c1a848ad 100644 (file)
@@ -69,7 +69,7 @@ PHP_FUNCTION(http_date)
 }
 /* }}} */
 
-/* {{{ proto string http_absolute_uri(string url[, string proto[, string host[, int port]]])
+/* {{{ proto string http_build_uri(string url[, string proto[, string host[, int port]]])
  *
  * This function returns an absolute URI constructed from url.
  * If the url is already abolute but a different proto was supplied,
@@ -86,7 +86,7 @@ PHP_FUNCTION(http_date)
  * </pre>
  *
  */
-PHP_FUNCTION(http_absolute_uri)
+PHP_FUNCTION(http_build_uri)
 {
        char *url = NULL, *proto = NULL, *host = NULL;
        int url_len = 0, proto_len = 0, host_len = 0;
@@ -118,6 +118,7 @@ PHP_FUNCTION(http_absolute_uri)
                                RETVAL_NULL(); \
                        } \
                        zend_hash_destroy(result); \
+                       FREE_HASHTABLE(result); \
                } \
        } else { \
                if (as_array) { \
index 1feabad71f9f28bcd407df7ffcc824d43b800eb7..024089d5b5c8415ce7c1a6d0ac669a4893844e1d 100644 (file)
@@ -36,7 +36,7 @@ HTTP_BEGIN_ARGS(date, 0)
        HTTP_ARG_VAL(timestamp, 0)
 HTTP_END_ARGS;
 
-HTTP_BEGIN_ARGS(absoluteUri, 1)
+HTTP_BEGIN_ARGS(buildUri, 1)
        HTTP_ARG_VAL(url, 0)
        HTTP_ARG_VAL(proto, 0)
        HTTP_ARG_VAL(host, 0)
@@ -84,7 +84,7 @@ HTTP_END_ARGS;
 zend_class_entry *http_util_object_ce;
 zend_function_entry http_util_object_fe[] = {
        HTTP_UTIL_ALIAS(date, http_date)
-       HTTP_UTIL_ALIAS(absoluteUri, http_absolute_uri)
+       HTTP_UTIL_ALIAS(buildUri, http_build_uri)
        HTTP_UTIL_ALIAS(negotiateLanguage, http_negotiate_language)
        HTTP_UTIL_ALIAS(negotiateCharset, http_negotiate_charset)
        HTTP_UTIL_ALIAS(matchModified, http_match_modified)
index 1079eaf28384ea31aa46dbfae7d2376e45622573..3bd580e251c47be9e896974c2ea1ce9ae8f177ac 100644 (file)
@@ -94,7 +94,7 @@ ZEND_END_MODULE_GLOBALS(http)
 
 PHP_FUNCTION(http_test);
 PHP_FUNCTION(http_date);
-PHP_FUNCTION(http_absolute_uri);
+PHP_FUNCTION(http_build_uri);
 PHP_FUNCTION(http_negotiate_language);
 PHP_FUNCTION(http_negotiate_charset);
 PHP_FUNCTION(http_redirect);