apache2/httpd-mod_deflate_head.patch
Roman Drahtmueller 90508856d0 Accepting request 80399 from home:elvigia:branches:Apache
- Update to version 2.2.20, fix CVE-2011-3192 
  mod_deflate D.o.S.

-  Fix apache PR 45076 

- Use SSL_MODE_RELEASE_BUFFERS to reduce mod_ssl memory usage

- Add 2 patches from the "low hanging fruit" warnings in apache
  STATUS page.
 * mod_deflate: Stop compressing HEAD requests 
  if there is not Content-Length header 
 * mod_reqtimeout: Disable keep-alive after read timeout

- Remove -fno-strict-aliasing from CFLAGS, no longer needed.

- Allow KeepAliveTimeout to be expressed in miliseconds
  sometimes one second is too long, upstream r733557.

- When linux changes to version 3.x configure tests are gonna break.
  remove version check, assuming kernel 2.2 or later.

OBS-URL: https://build.opensuse.org/request/show/80399
OBS-URL: https://build.opensuse.org/package/show/Apache/apache2?expand=0&rev=334
2011-08-31 13:46:57 +00:00

24 lines
892 B
Diff

--- modules/filters/mod_deflate.c.orig
+++ modules/filters/mod_deflate.c
@@ -582,6 +582,20 @@ static apr_status_t deflate_out_filter(a
apr_bucket *b;
apr_size_t len;
+ /*
+ * Optimization: If we are a HEAD request and bytes_sent is not zero
+ * it means that we have passed the content-length filter once and
+ * have more data to sent. This means that the content-length filter
+ * could not determine our content-length for the response to the
+ * HEAD request anyway (the associated GET request would deliver the
+ * body in chunked encoding) and we can stop compressing.
+ */
+ if (r->header_only && r->bytes_sent) {
+ ap_remove_output_filter(f);
+ return ap_pass_brigade(f->next, bb);
+ }
+
+
e = APR_BRIGADE_FIRST(bb);
if (APR_BUCKET_IS_EOS(e)) {