]> granicus.if.org Git - apache/commitdiff
The response to the TRACE method is partially garbled on an EBCDIC platform.
authorGreg Ames <gregames@apache.org>
Fri, 23 May 2008 14:52:33 +0000 (14:52 +0000)
committerGreg Ames <gregames@apache.org>
Fri, 23 May 2008 14:52:33 +0000 (14:52 +0000)
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/trunk@659560 13f79535-47bb-0310-9956-ffa450edef68

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

index 645803a5fd9440348629a8ba85ec61d26467823f..279713e3361c2a74925ec0110f2d3cabc63250fe 100644 (file)
@@ -653,6 +653,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 d48ba7e3f66196124cb765330e1dde90b6a89734..0bf3bc0d94509467423ea642c470d5881ca2b8c3 100644 (file)
@@ -1058,12 +1058,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) {