- 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 53b3222..c0cb89f 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 24a9e76..65547b8 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 7b048bc..e28a1df 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 b1039ad..9789977 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 b2a2081..d573ab2 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 7e04bf0..51e2ca2 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 ad7a878..1ed0e2c 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 b255e25..c917d86 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 4f31e31..84e979c 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 6785d59..1feabad 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 d1ddd46..11f78c5 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 e16c845..9ab75e9 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() \