From: Michael Wallner Date: Thu, 8 Sep 2005 11:41:53 +0000 (+0000) Subject: - ditch warnings X-Git-Tag: RELEASE_0_13_0~10 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=d83edb65a0097de2d5baa1a9fd9dbcebed34cc79;p=m6w6%2Fext-http - ditch warnings - update KnownIssues - tiny config.m4 improvment --- diff --git a/KnownIssues.txt b/KnownIssues.txt index 53b3222..c0cb89f 100644 --- a/KnownIssues.txt +++ b/KnownIssues.txt @@ -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 diff --git a/Makefile.frag b/Makefile.frag index 24a9e76..65547b8 100644 --- a/Makefile.frag +++ b/Makefile.frag @@ -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 diff --git a/config.m4 b/config.m4 index 7b048bc..e28a1df 100644 --- 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 --- 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 }; /* }}} */ diff --git a/http_headers_api.c b/http_headers_api.c index b2a2081..d573ab2 100644 --- a/http_headers_api.c +++ b/http_headers_api.c @@ -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)) { diff --git a/http_message_object.c b/http_message_object.c index 7e04bf0..51e2ca2 100644 --- a/http_message_object.c +++ b/http_message_object.c @@ -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; diff --git a/http_request_object.c b/http_request_object.c index ad7a878..1ed0e2c 100644 --- a/http_request_object.c +++ b/http_request_object.c @@ -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); diff --git a/http_requestpool_object.c b/http_requestpool_object.c index b255e25..c917d86 100644 --- a/http_requestpool_object.c +++ b/http_requestpool_object.c @@ -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; diff --git a/http_response_object.c b/http_response_object.c index 4f31e31..84e979c 100644 --- a/http_response_object.c +++ b/http_response_object.c @@ -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) diff --git a/http_util_object.c b/http_util_object.c index 6785d59..1feabad 100644 --- a/http_util_object.c +++ b/http_util_object.c @@ -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) diff --git a/php_http_request_object.h b/php_http_request_object.h index d1ddd46..11f78c5 100644 --- a/php_http_request_object.h +++ b/php_http_request_object.h @@ -106,8 +106,6 @@ PHP_METHOD(HttpRequest, methodUnregister); PHP_METHOD(HttpRequest, methodName); PHP_METHOD(HttpRequest, methodExists); -PHP_METHOD(HttpRequest, debugWrapper); - #endif #endif #endif diff --git a/php_http_std_defs.h b/php_http_std_defs.h index e16c845..9ab75e9 100644 --- a/php_http_std_defs.h +++ b/php_http_std_defs.h @@ -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() \