- update package
authorMichael Wallner <mike@php.net>
Tue, 27 Dec 2005 11:38:05 +0000 (11:38 +0000)
committerMichael Wallner <mike@php.net>
Tue, 27 Dec 2005 11:38:05 +0000 (11:38 +0000)
http.c
package2.xml
tests/ob_deflatehandler_001.phpt [new file with mode: 0644]
tests/ob_inflatehandler_001.phpt [new file with mode: 0644]

diff --git a/http.c b/http.c
index 14b25bcf49ab67e3cc2a52cdc554aa8af0a5527f..c9e693126f2c9839a1e627524b9b4751108575bd 100644 (file)
--- a/http.c
+++ b/http.c
@@ -216,9 +216,9 @@ PHP_INI_BEGIN()
 #endif
        HTTP_PHP_INI_ENTRY("http.force_exit", "1", PHP_INI_ALL, OnUpdateBool, force_exit)
 #ifdef HTTP_HAVE_ZLIB
-       HTTP_PHP_INI_ENTRY("http.ob_inflate_auto", "0", PHP_INI_ALL, OnUpdateBool, send.inflate.start_auto)
+       HTTP_PHP_INI_ENTRY("http.ob_inflate_auto", "0", PHP_INI_PERDIR, OnUpdateBool, send.inflate.start_auto)
        HTTP_PHP_INI_ENTRY("http.ob_inflate_flags", "0", PHP_INI_ALL, OnUpdateLong, send.inflate.start_flags)
-       HTTP_PHP_INI_ENTRY("http.ob_deflate_auto", "0", PHP_INI_ALL, OnUpdateBool, send.deflate.start_auto)
+       HTTP_PHP_INI_ENTRY("http.ob_deflate_auto", "0", PHP_INI_PERDIR, OnUpdateBool, send.deflate.start_auto)
        HTTP_PHP_INI_ENTRY("http.ob_deflate_flags", "0", PHP_INI_ALL, OnUpdateLong, send.deflate.start_flags)
 #endif
 PHP_INI_END()
@@ -338,6 +338,10 @@ PHP_MINFO_FUNCTION(http)
                        "HttpRequest, "
                        "HttpRequestPool, "
 #      endif
+#      ifdef HTTP_HAVE_ZLIB
+                       "HttpDeflateStream, "
+                       "HttpInflateStream, "
+#      endif
 #      ifndef WONKY
                        "HttpResponse"
 #      endif
index 73838c65ab3f6a5bdec8cdb6dd54813c635e21e1..26b487cc9aa852dc8997b3201419ddad300506a4 100644 (file)
@@ -23,7 +23,11 @@ It provides powerful request functionality, if built with CURL
 support. Parallel requests are available for PHP-5 and greater.
 
 PHP-5 classes:
-HttpUtil, HttpMessage, HttpRequest, HttpRequestPool; HttpResponse (PHP-5.1)
+HttpUtil, HttpMessage, HttpRequest, HttpRequestPool, 
+HttpDeflateStream, HttpInflateStream
+
+PHP-5.1 classes:
+HttpResponse
 ]]></description>
  <lead>
   <name>Michael Wallner</name>
@@ -33,8 +37,8 @@ HttpUtil, HttpMessage, HttpRequest, HttpRequestPool; HttpResponse (PHP-5.1)
  </lead>
  <date>2005-00-00</date>
  <version>
-  <release>0.20.0</release>
-  <api>0.20.0</api>
+  <release>0.21.0</release>
+  <api>0.21.0</api>
  </version>
  <stability>
   <release>beta</release>
@@ -42,26 +46,18 @@ HttpUtil, HttpMessage, HttpRequest, HttpRequestPool; HttpResponse (PHP-5.1)
  </stability>
  <license>BSD, revised</license>
  <notes><![CDATA[
-! Request functionality requires libcurl >= 7.12.3 now
+! Encodings functionality requires libz version 1.2.0.4 or greater
+
++ Added HttpDeflateStream and HttpInflateStream classes
++ Added ob_deflatehandler and ob_inflatehandler
++ Added HttpRequest::getRawRequestMessage and ::getRawResponseMessage
++ Added 'resetcookies' request option (libcurl > 7.15)
 
-+ Added 'bodyonly' request option
-+ Added IOCTL callback for cURL
-+ Added ssl_engines array and cookies array to the request info array
-+ Added http_parse_cookie() to parse Set-Cookie headers
+- Changed HttpRequest properties to be private
 
-- Renamed http_connectcode to connect_code in the request info array
-- Enable "original headers" previously stripped off by the message parser:
-       o X-Original-Transfer-Encoding (Transfer-Encoding)
-       o X-Original-Content-Encoding (Content-Encoding)
-       o X-Original-Content-Length (Content-Length)
-- RequestExceptions thrown by HttpRequestPool::__construct() and send() are
-  now wrapped into the HttpRequestPoolException object's $exceptionStack property
-- Removed http_compress() and http_uncompress() (http_deflate/inflate ambiguity)
+* Fixed a lot of memory corruptions within HttpRequest
 
-* Fixed bug which caused GZIP encoded archives to be decoded
-* Fixed bug with DEFLATE encoded response messages
-* Fixed several memory leaks and inconspicuous access violations
-* Fixed some logical errors in the uri builder
+Special thanks for this release go to Ilia Alshanetsky.
 ]]></notes>
  <contents>
   <dir name="/">
@@ -103,6 +99,8 @@ HttpUtil, HttpMessage, HttpRequest, HttpRequestPool; HttpResponse (PHP-5.1)
    <file role="src" name="php_http_send_api.h"/>
    <file role="src" name="php_http_url_api.h"/>
    <file role="src" name="php_http_util_object.h"/>
+   <file role="src" name="php_http_deflatestream_object.h"/>
+   <file role="src" name="php_http_inflatestream_object.h"/>
    <file role="src" name="php_http_message_object.h"/>
    <file role="src" name="php_http_request_object.h"/>
    <file role="src" name="php_http_requestpool_object.h"/>
@@ -126,6 +124,8 @@ HttpUtil, HttpMessage, HttpRequest, HttpRequestPool; HttpResponse (PHP-5.1)
    <file role="src" name="http_send_api.c"/>
    <file role="src" name="http_url_api.c"/>
    <file role="src" name="http_util_object.c"/>
+   <file role="src" name="http_deflatestream_object.c"/>
+   <file role="src" name="http_inflatestream_object.c"/>
    <file role="src" name="http_message_object.c"/>
    <file role="src" name="http_request_object.c"/>
    <file role="src" name="http_requestpool_object.c"/>
@@ -137,13 +137,13 @@ HttpUtil, HttpMessage, HttpRequest, HttpRequestPool; HttpResponse (PHP-5.1)
     <file role="test" name="urls.txt"/>
     <file role="test" name="skip.inc"/>
     <file role="test" name="log.inc"/>
-    <file role="test" name="abs_uri_001.phpt"/>
-    <file role="test" name="abs_uri_002.phpt"/>
     <file role="test" name="allowed_methods_001.phpt"/>
     <file role="test" name="allowed_methods_001_logging.phpt"/>
     <file role="test" name="allowed_methods_002.phpt"/>
     <file role="test" name="allowed_methods_002_logging.phpt"/>
-    <file role="test" name="build_uri_001.phpt"/>
+    <file role="test" name="build_url_001.phpt"/>
+    <file role="test" name="build_url_002.phpt"/>
+    <file role="test" name="build_url_003.phpt"/>
     <file role="test" name="chunked_decode_001.phpt"/>
     <file role="test" name="chunked_decode_002.phpt"/>
     <file role="test" name="chunked_decode_003.phpt"/>
@@ -151,6 +151,7 @@ HttpUtil, HttpMessage, HttpRequest, HttpRequestPool; HttpResponse (PHP-5.1)
     <file role="test" name="cloning_001.phpt"/>
     <file role="test" name="date_001.phpt"/>
     <file role="test" name="date_002.phpt"/>
+    <file role="test" name="encoding_objects_001.phpt"/>
     <file role="test" name="encodings.phpt"/>
     <file role="test" name="etag_mode_001.phpt"/>
     <file role="test" name="etag_mode_002.phpt"/>
@@ -176,10 +177,12 @@ HttpUtil, HttpMessage, HttpRequest, HttpRequestPool; HttpResponse (PHP-5.1)
     <file role="test" name="HttpRequest_001.phpt"/>
     <file role="test" name="HttpRequest_002.phpt"/>
     <file role="test" name="HttpRequest_003.phpt"/>
+    <file role="test" name="HttpRequest_004.phpt"/>
     <file role="test" name="HttpRequestPool_001.phpt"/>
     <file role="test" name="HttpRequestPool_002.phpt"/>
     <file role="test" name="HttpRequestPool_003.phpt"/>
     <file role="test" name="HttpRequestPool_004.phpt"/>
+    <file role="test" name="HttpRequestPool_005.phpt"/>
     <file role="test" name="HttpResponse_001.phpt"/>
     <file role="test" name="HttpResponse_002.phpt"/>
     <file role="test" name="HttpResponse_003.phpt"/>
@@ -187,6 +190,8 @@ HttpUtil, HttpMessage, HttpRequest, HttpRequestPool; HttpResponse (PHP-5.1)
     <file role="test" name="INI_001.phpt"/>
     <file role="test" name="match_request_header_001.phpt"/>
     <file role="test" name="negotiation_001.phpt"/>
+    <file role="test" name="ob_deflatehandler_001.phpt"/>
+    <file role="test" name="ob_inflatehandler_002.phpt"/>
     <file role="test" name="parse_headers_001.phpt"/>
     <file role="test" name="parse_message_001.phpt"/>
     <file role="test" name="parse_message_002.phpt"/>
@@ -249,7 +254,6 @@ HttpUtil, HttpMessage, HttpRequest, HttpRequestPool; HttpResponse (PHP-5.1)
   <optional>
    <extension><name>session</name></extension>
    <extension><name>hash</name></extension>
-   <extension><name>zlib</name></extension>
   </optional>
  </dependencies>
  <providesextension>http</providesextension>
diff --git a/tests/ob_deflatehandler_001.phpt b/tests/ob_deflatehandler_001.phpt
new file mode 100644 (file)
index 0000000..ba39581
--- /dev/null
@@ -0,0 +1,22 @@
+--TEST--
+ob_deflatehandler
+--SKIPIF--
+<?php
+include 'skip.inc';
+checkcgi();
+skipif(!http_support(HTTP_SUPPORT_ENCODINGS), "need zlib");
+?>
+--ENV--
+HTTP_ACCEPT_ENCODING=gzip
+--FILE--
+<?php
+ob_start('ob_deflatehandler');
+echo "-TEST\n";
+echo "Done\n";
+?>
+--EXPECTF--
+%s
+Content-Encoding: gzip
+Vary: Accept-Encoding
+%s
+
diff --git a/tests/ob_inflatehandler_001.phpt b/tests/ob_inflatehandler_001.phpt
new file mode 100644 (file)
index 0000000..2e494de
--- /dev/null
@@ -0,0 +1,16 @@
+--TEST--
+ob_inflatehandler
+--SKIPIF--
+<?php
+include 'skip.inc';
+checkcgi();
+skipif(!http_support(HTTP_SUPPORT_ENCODINGS), "need zlib");
+?>
+--FILE--
+<?php
+ob_start('ob_inflatehandler');
+echo http_deflate("TEST\n");
+?>
+--EXPECTF--
+%sTEST
+