- ditch warnings
authorMichael Wallner <mike@php.net>
Thu, 8 Sep 2005 11:41:53 +0000 (11:41 +0000)
committerMichael Wallner <mike@php.net>
Thu, 8 Sep 2005 11:41:53 +0000 (11:41 +0000)
- update KnownIssues
- tiny config.m4 improvment

12 files changed:
KnownIssues.txt
Makefile.frag
config.m4
http.c
http_headers_api.c
http_message_object.c
http_request_object.c
http_requestpool_object.c
http_response_object.c
http_util_object.c
php_http_request_object.h
php_http_std_defs.h

index 53b3222e288eec62429e493932b4ce9d120150f5..c0cb89f86fdc9062e43f303ef9238f6b6f13d5ff 100644 (file)
@@ -5,3 +5,9 @@ $Id$
 HttpResponse class is only available for PHP >= 5.1
 
 Not all places where files are handled check for open_basedir and/or safe_mode.
+
+
+Internals:
+       -       the request bodies created in http_request_pool_attach() are not 
+               destroyed in http_request_pool_detach(); may be a memory problem 
+               in long running scripts
\ No newline at end of file
index 24a9e76be9fb0ed12bf3f69644fa63ed94658a8c..65547b8654b9ff6262437988d145a469bea53a23 100644 (file)
@@ -1,24 +1,5 @@
 phpincludedir=$(prefix)/include/php
 
-HTTP_HEADER_FILES= \
-       phpstr/phpstr.h \
-       php_http_cache_api.h \
-       php_http_headers_api.h \
-       php_http_response_object.h \
-       php_http_util_object.h \
-       php_http.h \
-       php_http_request_api.h \
-       php_http_message_api.h \
-       php_http_send_api.h \
-       php_http_api.h \
-       php_http_date_api.h \
-       php_http_message_object.h \
-       php_http_std_defs.h \
-       php_http_exception_object.h \
-       php_http_request_object.h \
-       php_http_requestpool_object.h \
-       php_http_url_api.h
-
 install-http-headers:
        @echo "Installing HTTP headers:          $(INSTALL_ROOT)$(phpincludedir)/ext/http/"
        @$(mkinstalldirs) $(INSTALL_ROOT)$(phpincludedir)/ext/http
index 7b048bc63458320efb8ab21940b56b19b3917b86..e28a1dfe96e7fc1b46e20c8e9830fe2588c76969 100644 (file)
--- a/config.m4
+++ b/config.m4
@@ -140,13 +140,29 @@ dnl ----
        PHP_NEW_EXTENSION([http], $PHP_HTTP_SOURCES, [$ext_shared])
        PHP_ADD_BUILD_DIR($ext_builddir/phpstr, 1)
        PHP_SUBST([HTTP_SHARED_LIBADD])
-       PHP_ADD_MAKEFILE_FRAGMENT
-       AC_DEFINE([HAVE_HTTP], [1], [Have extended HTTP support])
 
-dnl ---
-dnl odd warnings
-dnl ---
-dnl            CFLAGS=" -g -O2 -W -Wchar-subscripts -Wformat=2 -Wno-format-y2k -Wimplicit -Wmissing-braces -Wunused-variable -Wbad-function-cast -Wpointer-arith -Wsign-compare -Winline"
-dnl            PHP_SUBST([CFLAGS])
+       HTTP_HEADER_FILES= \
+               phpstr/phpstr.h \
+               php_http_std_defs.h \
+               php_http.h \
+               php_http_api.h \
+               php_http_cache_api.h \
+               php_http_date_api.h \
+               php_http_headers_api.h \
+               php_http_info_api.h \
+               php_http_message_api.h \
+               php_http_request_api.h \
+               php_http_request_method_api.h \
+               php_http_send_api.h \
+               php_http_url_api.h
+       PHP_SUBST([HTTP_HEADER_FILES])
+
+       ifdef([PHP_INSTALL_HEADERS],
+       [
+               PHP_INSTALL_HEADERS(ext/http, [HTTP_HEADER_FILES])
+       ], [
+               PHP_ADD_MAKEFILE_FRAGMENT
+       ])
 
+       AC_DEFINE([HAVE_HTTP], [1], [Have extended HTTP support])
 fi
diff --git a/http.c b/http.c
index b1039ade5fa4024e3cb741a5afa0aaa5905436eb..97899774f9f3a764f325d053bf076ecbb1476c0b 100644 (file)
--- a/http.c
+++ b/http.c
@@ -71,7 +71,7 @@ ZEND_GET_MODULE(http)
 #endif
 
 /* {{{ http_functions[] */
-function_entry http_functions[] = {
+zend_function_entry http_functions[] = {
        PHP_FE(http_test, NULL)
        PHP_FE(http_date, NULL)
        PHP_FE(http_absolute_uri, NULL)
@@ -112,7 +112,8 @@ function_entry http_functions[] = {
        PHP_FE(http_build_query, NULL)
 #endif
        PHP_FE(ob_etaghandler, NULL)
-       {NULL, NULL, NULL}
+       
+       EMPTY_FUNCTION_ENTRY
 };
 /* }}} */
 
index b2a2081e18ae79bd5cf8a1c601befd238972a08f..d573ab27b601aa4d0533cf9d28cc46b70b0adc9c 100644 (file)
@@ -254,7 +254,11 @@ PHP_HTTP_API STATUS _http_parse_headers_ex(const char *header, HashTable *header
        zval array;
 
        Z_ARRVAL(array) = headers;
-       header_len = body ? body - header : strlen(header) + 1;
+       if (body) {
+               header_len = body - header;
+       } else {
+               header_len = strlen(header) + 1;
+       }
        line = header;
 
        while (header_len >= (size_t) (line - begin)) {
index 7e04bf0537994cd7d3125c8d07e9d00a62b225ba..51e2ca21831261083f6bc6a1c30c8c609640a5ca 100644 (file)
@@ -123,7 +123,8 @@ zend_function_entry http_message_object_fe[] = {
        ZEND_MALIAS(HttpMessage, __toString, toString, HTTP_ARGS(HttpMessage, toString), ZEND_ACC_PUBLIC)
 
        HTTP_MESSAGE_ME(fromString, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC)
-       {NULL, NULL, NULL}
+       
+       EMPTY_FUNCTION_ENTRY
 };
 static zend_object_handlers http_message_object_handlers;
 
index ad7a8786d5e79734222975163f27e6bff9bf5f94..1ed0e2c154d71d12c14dc69bd47a825f01238927 100644 (file)
@@ -276,7 +276,7 @@ zend_function_entry http_request_object_fe[] = {
        HTTP_REQUEST_ALIAS(methodName, http_request_method_name)
        HTTP_REQUEST_ALIAS(methodExists, http_request_method_exists)
 
-       {NULL, NULL, NULL}
+       EMPTY_FUNCTION_ENTRY
 };
 static zend_object_handlers http_request_object_handlers;
 
@@ -1520,7 +1520,6 @@ PHP_METHOD(HttpRequest, getHistory)
  */
 PHP_METHOD(HttpRequest, send)
 {
-       STATUS status = FAILURE;
        http_request_body body = {0, NULL, 0};
        getObject(http_request_object, obj);
 
index b255e25ee2b58f83c3d9fbf6f72a7f62bcd3b636..c917d8615c809713d69d97f8774d16310d58ffa0 100644 (file)
@@ -89,7 +89,7 @@ zend_function_entry http_requestpool_object_fe[] = {
        HTTP_REQPOOL_ME(next, ZEND_ACC_PUBLIC)
        HTTP_REQPOOL_ME(rewind, ZEND_ACC_PUBLIC)
 
-       {NULL, NULL, NULL}
+       EMPTY_FUNCTION_ENTRY
 };
 static zend_object_handlers http_requestpool_object_handlers;
 
index 4f31e3158fd050871e93b89df2c09eb7c9318d59..84e979c7610992381283cf730836765a6d2dace6 100644 (file)
@@ -200,7 +200,7 @@ zend_function_entry http_response_object_fe[] = {
        HTTP_RESPONSE_ALIAS(getRequestHeaders, http_get_request_headers)
        HTTP_RESPONSE_ALIAS(getRequestBody, http_get_request_body)
 
-       {NULL, NULL, NULL}
+       EMPTY_FUNCTION_ENTRY
 };
 
 void _http_response_object_init(INIT_FUNC_ARGS)
index 6785d59ffa0a3d5e4f3452b26bc84a92f501d1a0..1feabad71f9f28bcd407df7ffcc824d43b800eb7 100644 (file)
@@ -93,7 +93,8 @@ zend_function_entry http_util_object_fe[] = {
        HTTP_UTIL_ALIAS(chunkedDecode, http_chunked_decode)
        HTTP_UTIL_ALIAS(parseMessage, http_parse_message)
        HTTP_UTIL_ALIAS(parseHeaders, http_parse_headers)
-       {NULL, NULL, NULL}
+       
+       EMPTY_FUNCTION_ENTRY
 };
 
 void _http_util_object_init(INIT_FUNC_ARGS)
index d1ddd46519e00fd1ae8204d51fe37adccf16f559..11f78c56482d7ec84f8f9d925ce2c6714c4a812b 100644 (file)
@@ -106,8 +106,6 @@ PHP_METHOD(HttpRequest, methodUnregister);
 PHP_METHOD(HttpRequest, methodName);
 PHP_METHOD(HttpRequest, methodExists);
 
-PHP_METHOD(HttpRequest, debugWrapper);
-
 #endif
 #endif
 #endif
index e16c8454e7c5dc1eef434995edca85e7d8b080a8..9ab75e9dbef017743f13eb0a451e187c219ad8af 100644 (file)
@@ -306,6 +306,12 @@ typedef int STATUS;
 #      define HTTP_ARG_OBJ(class, name, allow_null)                            ZEND_ARG_OBJ_INFO(1, name, class, allow_null)
 #endif
 
+#ifdef ZEND_ENGINE_2
+#      define EMPTY_FUNCTION_ENTRY {NULL, NULL, NULL, 0}
+#else
+#      define EMPTY_FUNCTION_ENTRY {NULL, NULL, NULL}
+#endif
+
 #ifdef HTTP_HAVE_CURL
 #      ifdef ZEND_ENGINE_2
 #              define HTTP_DECLARE_ARG_PASS_INFO() \