]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Merge r659560, r660485 from trunk:
authorEric Covener <covener@apache.org>
Tue, 27 May 2008 21:43:39 +0000 (21:43 +0000)
committerEric Covener <covener@apache.org>
Tue, 27 May 2008 21:43:39 +0000 (21:43 +0000)
The response to the TRACE method is partially garbled on an EBCDIC platform.
Send the request line and trailing CRLF in ASCII.

Submitted by:           David Jones <oscaremma gmail.com>
Reviewed and tested by: gregames

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@660728 13f79535-47bb-0310-9956-ffa450edef68

CHANGES
STATUS
include/httpd.h
modules/http/http_filters.c

diff --git a/CHANGES b/CHANGES
index 3542d3e0762eea4de905dc89b16f31ceb3a0dba0..5c724d0d378eb7fbe69acdb2d67c8528b7b47e7c 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,9 @@
                                                          -*- coding: utf-8 -*-
 Changes with Apache 2.2.9
 
+  *) Fix garbled TRACE response on EBCDIC platforms.
+     [David Jones <oscaremma gmail.com>]
+
   *) ab: Include <limits.h> earlier if available since we may need
      INT_MAX (defined there on Windows) for the definition of MAX_REQUESTS.
      PR 45024 [Ruediger Pluem]
diff --git a/STATUS b/STATUS
index ce223271549f29587776fd672262048af878e409..e0882d46cb0a9358682aa388275f20fe34f50db5 100644 (file)
--- a/STATUS
+++ b/STATUS
@@ -97,14 +97,6 @@ PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
          Trunk version of patch works
    +1: rpluem, trawick, fielding
 
- * Fix garbled TRACE response on EBCDIC platforms.
-   Trunk version of patch:
-         http://svn.apache.org/viewvc?view=rev&revision=659560
-         http://svn.apache.org/viewvc?view=rev&revision=660485
-   Backport version for 2.2.x of patch:
-         Trunk version of patch works
-   +1: trawick, jim, covener
-
 PATCHES PROPOSED TO BACKPORT FROM TRUNK:
   [ New proposals should be added at the end of the list ]
 
index 15e1f11ddea13b31a18866743a66c13a753276be..542b6eaa7a2e4bc615ac7c9632cd19126cbaa86a 100644 (file)
@@ -666,6 +666,8 @@ struct ap_method_list_t {
 #define LF '\n'
 #define CRLF "\r\n"
 #endif /* APR_CHARSET_EBCDIC */                                   
+/** Useful for common code with either platform charset. */
+#define CRLF_ASCII "\015\012"
 
 /**
  * @defgroup values_request_rec_body Possible values for request_rec.read_body 
index 09fa220bf3535a46ba11a57c6f6c105ce190a697..c078a7c58b33adc42f72bfea1daecbb446831913 100644 (file)
@@ -1057,12 +1057,23 @@ AP_DECLARE_NONSTD(int) ap_send_http_trace(request_rec *r)
     /* Now we recreate the request, and echo it back */
 
     bb = apr_brigade_create(r->pool, r->connection->bucket_alloc);
+#if APR_CHARSET_EBCDIC
+    {
+        char *tmp;
+        apr_size_t len;
+        len = strlen(r->the_request);
+        tmp = apr_pmemdup(r->pool, r->the_request, len);
+        ap_xlate_proto_to_ascii(tmp, len);
+        apr_brigade_putstrs(bb, NULL, NULL, tmp, CRLF_ASCII, NULL);
+    }
+#else
     apr_brigade_putstrs(bb, NULL, NULL, r->the_request, CRLF, NULL);
+#endif
     h.pool = r->pool;
     h.bb = bb;
     apr_table_do((int (*) (void *, const char *, const char *))
                  form_header_field, (void *) &h, r->headers_in, NULL);
-    apr_brigade_puts(bb, NULL, NULL, CRLF);
+    apr_brigade_puts(bb, NULL, NULL, CRLF_ASCII);
 
     /* If configured to accept a body, echo the body */
     if (bodylen) {