]> granicus.if.org Git - php/commitdiff
@- When using the ob_gzhandler() PHP now automagically also sets the
authorThies C. Arntzen <thies@php.net>
Thu, 1 Feb 2001 17:14:18 +0000 (17:14 +0000)
committerThies C. Arntzen <thies@php.net>
Thu, 1 Feb 2001 17:14:18 +0000 (17:14 +0000)
@  Content-Lengh correctly which enables browsers to use the HTTP
@  Keep-Alive feature. (Thies)

ext/zlib/zlib.c

index ed8299e6d0536c82df9b323b811ac3c1b91c1874..59b370d18b8276d8c88db827a613dc9decb489f5 100644 (file)
@@ -1115,8 +1115,14 @@ PHP_FUNCTION(ob_gzhandler)
                                return_original = 1;
                                break;
                }
+
                if (return_original) {
                        zval_dtor(return_value);
+               } else {
+                       char lenbuf[ 64 ];
+                       
+                       sprintf(lenbuf,"Content-Length: %d",Z_STRLEN_P(return_value));
+                       sapi_add_header(lenbuf,strlen(lenbuf), 1);
                }
        } else {
                return_original = 1;