fxed bug #17169 wrong return value of HttpMessage::getHttpVersion()
[m6w6/ext-http] / http_deflatestream_object.c
index 01e8ae2c8e7058afb7aacfb972909bd7b1515d01..c3c80458685d9ce880d961b789cf8d450163be18 100644 (file)
@@ -6,7 +6,7 @@
     | modification, are permitted provided that the conditions mentioned |
     | in the accompanying LICENSE file are met.                          |
     +--------------------------------------------------------------------+
-    | Copyright (c) 2004-2007, Michael Wallner <mike@php.net>            |
+    | Copyright (c) 2004-2010, Michael Wallner <mike@php.net>            |
     +--------------------------------------------------------------------+
 */
 
@@ -242,8 +242,10 @@ PHP_METHOD(HttpDeflateStream, flush)
                        STR_FREE(encoded);
                        updated_len += encoded_len;
                        RETURN_STRINGL(updated, updated_len, 0);
-               } else {
+               } else if (encoded) {
                        RETVAL_STRINGL(encoded, encoded_len, 0);
+               } else {
+                       RETVAL_NULL();
                }
        } else {
                RETVAL_FALSE;