~ubuntu-branches/ubuntu/dapper/apache2/dapper

« back to all changes in this revision

Viewing changes to debian/patches/044_content_length_CAN-2005-2088

  • Committer: Bazaar Package Importer
  • Author(s): Adam Conrad
  • Date: 2005-10-24 13:02:52 UTC
  • mfrom: (0.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20051024130252-1falzxxyrndau13m
Tags: 2.0.55-3
Brown paper bag release: Tidy up CFLAGS and APR configure call to make
sure that what we link to agrees with what apu-config tells others to do.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
diff -ruN -x configure -x '*~' -x build-tree.orig -x '*.rej' build-tree.orig/apache2/modules/proxy/proxy_http.c build-tree/apache2/modules/proxy/proxy_http.c
2
 
--- build-tree.orig/apache2/modules/proxy/proxy_http.c  2005-02-04 20:21:18.000000000 +0000
3
 
+++ build-tree/apache2/modules/proxy/proxy_http.c       2005-08-02 09:25:21.000000000 +0000
4
 
@@ -768,8 +768,24 @@
5
 
                 return r->status;
6
 
 
7
 
             } else {
8
 
-                /* strip connection listed hop-by-hop headers from response */
9
 
                 const char *buf;
10
 
+
11
 
+                /* can't have both Content-Length and Transfer-Encoding */
12
 
+                if (apr_table_get(r->headers_out, "Transfer-Encoding")
13
 
+                    && apr_table_get(r->headers_out, "Content-Length")) {
14
 
+                    /* 2616 section 4.4, point 3: "if both Transfer-Encoding
15
 
+                     * and Content-Length are received, the latter MUST be
16
 
+                     * ignored"; so unset it here to prevent any confusion
17
 
+                     * later. */
18
 
+                    apr_table_unset(r->headers_out, "Content-Length");
19
 
+                    ap_log_error(APLOG_MARK, APLOG_DEBUG, 0,
20
 
+                                 r->server,
21
 
+                                 "proxy: server %s returned Transfer-Encoding and Content-Length",
22
 
+                                 p_conn->name);
23
 
+                    p_conn->close += 1;
24
 
+                }
25
 
+                
26
 
+                /* strip connection listed hop-by-hop headers from response */
27
 
                 p_conn->close += ap_proxy_liststr(apr_table_get(r->headers_out,
28
 
                                                                 "Connection"),
29
 
                                                   "close");
30
 
diff -ruN -x configure -x '*~' -x build-tree.orig -x '*.rej' build-tree.orig/apache2/server/protocol.c build-tree/apache2/server/protocol.c
31
 
--- build-tree.orig/apache2/server/protocol.c   2005-08-02 09:25:38.000000000 +0000
32
 
+++ build-tree/apache2/server/protocol.c        2005-08-02 09:25:12.000000000 +0000
33
 
@@ -885,6 +885,15 @@
34
 
             apr_brigade_destroy(tmp_bb);
35
 
             return r;
36
 
         }
37
 
+
38
 
+        if (apr_table_get(r->headers_in, "Transfer-Encoding")
39
 
+            && apr_table_get(r->headers_in, "Content-Length")) {
40
 
+            /* 2616 section 4.4, point 3: "if both Transfer-Encoding
41
 
+             * and Content-Length are received, the latter MUST be
42
 
+             * ignored"; so unset it here to prevent any confusion
43
 
+             * later. */
44
 
+            apr_table_unset(r->headers_in, "Content-Length");
45
 
+        }
46
 
     }
47
 
     else {
48
 
         if (r->header_only) {