You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by gr...@apache.org on 2008/05/23 16:52:34 UTC
svn commit: r659560 - in /httpd/httpd/trunk: include/httpd.h
modules/http/http_filters.c
Author: gregames
Date: Fri May 23 07:52:33 2008
New Revision: 659560
URL: http://svn.apache.org/viewvc?rev=659560&view=rev
Log:
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
Modified:
httpd/httpd/trunk/include/httpd.h
httpd/httpd/trunk/modules/http/http_filters.c
Modified: httpd/httpd/trunk/include/httpd.h
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/include/httpd.h?rev=659560&r1=659559&r2=659560&view=diff
==============================================================================
--- httpd/httpd/trunk/include/httpd.h (original)
+++ httpd/httpd/trunk/include/httpd.h Fri May 23 07:52:33 2008
@@ -653,6 +653,8 @@
#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
Modified: httpd/httpd/trunk/modules/http/http_filters.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/http/http_filters.c?rev=659560&r1=659559&r2=659560&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/http/http_filters.c (original)
+++ httpd/httpd/trunk/modules/http/http_filters.c Fri May 23 07:52:33 2008
@@ -1058,12 +1058,23 @@
/* 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) {