You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by jc...@apache.org on 2017/01/06 19:55:46 UTC

svn commit: r1777707 - in /httpd/httpd/branches/trunk-test-integration: ./ docs/ docs/manual/mod/ include/ modules/cache/ modules/http/ modules/proxy/ server/

Author: jchampion
Date: Fri Jan  6 19:55:46 2017
New Revision: 1777707

URL: http://svn.apache.org/viewvc?rev=1777707&view=rev
Log:
sync merge with trunk

Modified:
    httpd/httpd/branches/trunk-test-integration/   (props changed)
    httpd/httpd/branches/trunk-test-integration/CHANGES
    httpd/httpd/branches/trunk-test-integration/STATUS
    httpd/httpd/branches/trunk-test-integration/docs/   (props changed)
    httpd/httpd/branches/trunk-test-integration/docs/manual/mod/core.html.en
    httpd/httpd/branches/trunk-test-integration/docs/manual/mod/core.xml.de
    httpd/httpd/branches/trunk-test-integration/docs/manual/mod/core.xml.es
    httpd/httpd/branches/trunk-test-integration/docs/manual/mod/core.xml.fr
    httpd/httpd/branches/trunk-test-integration/docs/manual/mod/core.xml.ja
    httpd/httpd/branches/trunk-test-integration/docs/manual/mod/core.xml.tr
    httpd/httpd/branches/trunk-test-integration/docs/manual/mod/mod_http2.html.en
    httpd/httpd/branches/trunk-test-integration/docs/manual/mod/mod_http2.xml
    httpd/httpd/branches/trunk-test-integration/include/httpd.h
    httpd/httpd/branches/trunk-test-integration/modules/cache/cache_util.c
    httpd/httpd/branches/trunk-test-integration/modules/http/chunk_filter.c
    httpd/httpd/branches/trunk-test-integration/modules/http/http_filters.c
    httpd/httpd/branches/trunk-test-integration/modules/proxy/config.m4
    httpd/httpd/branches/trunk-test-integration/modules/proxy/mod_proxy_http.c
    httpd/httpd/branches/trunk-test-integration/server/protocol.c
    httpd/httpd/branches/trunk-test-integration/server/vhost.c

Propchange: httpd/httpd/branches/trunk-test-integration/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Jan  6 19:55:46 2017
@@ -1,2 +1,3 @@
 /httpd/httpd/branches/revert-ap-ldap:1150158-1150173
 /httpd/httpd/branches/wombat-integration:723609-723841
+/httpd/httpd/trunk:1777251-1777705

Modified: httpd/httpd/branches/trunk-test-integration/CHANGES
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/trunk-test-integration/CHANGES?rev=1777707&r1=1777706&r2=1777707&view=diff
==============================================================================
--- httpd/httpd/branches/trunk-test-integration/CHANGES [utf-8] (original)
+++ httpd/httpd/branches/trunk-test-integration/CHANGES [utf-8] Fri Jan  6 19:55:46 2017
@@ -1,6 +1,9 @@
                                                          -*- coding: utf-8 -*-
 Changes with Apache 2.5.0
 
+  *) core: EBCDIC fixes for interim responses with additional headers.
+     [Eric Covener]
+
   *) mod_http2: fix for possible page fault when stream is resumed during 
      session shutdown. [sidney-j-r-m (github)]
      

Modified: httpd/httpd/branches/trunk-test-integration/STATUS
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/trunk-test-integration/STATUS?rev=1777707&r1=1777706&r2=1777707&view=diff
==============================================================================
--- httpd/httpd/branches/trunk-test-integration/STATUS (original)
+++ httpd/httpd/branches/trunk-test-integration/STATUS Fri Jan  6 19:55:46 2017
@@ -129,6 +129,24 @@ THINGS THAT SHOULD BE CONSIDERED EARLY I
   * Modify configuration syntax to separate meta-directives from runtime
     directives (e.g. If vs. IfVersion).
 
+  * Support JSON-like configuration files
+
+  * Opaque data structures w/ getters/setters 
+
+  * Generic interface to enable runtime changes (adjusting log level, modifying
+    balancer information, toggling flags on/off). Perhaps modules can register
+    callbacks for making these changes?
+
+  * REST-based administration for existing (balancer/etc) and new dynamic
+    runtime changes (see above)
+
+  * Improve the look of generated pages (status, load-balancer...) with dynamic
+    update of the values. Generate HTML5 pages, instead of 3.2, Get rid of XHTML
+    in the generated pages.
+
+  * Add performance monitoring of the server, of each module (?), in order to help
+    understanding what worth looking at in order to improve overall performance.
+    (https://cdn.wp.nginx.com/wp-content/uploads/2016/12/Amplify-Dashboards-page-base-for-filters.png)
 
 OLD ISSUES THAT WERE THOUGHT TO BE SHOWSTOPPERS FOR 2.4 BUT OBVIOUSLY WEREN'T:
 

Propchange: httpd/httpd/branches/trunk-test-integration/docs/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Jan  6 19:55:46 2017
@@ -1,3 +1,4 @@
 /httpd/httpd/branches/2.4.x/docs:1537109
 /httpd/httpd/branches/revert-ap-ldap/docs:1150158-1150173
 /httpd/httpd/branches/wombat-integration/docs:723609-723841
+/httpd/httpd/trunk/docs:1777251-1777705

Modified: httpd/httpd/branches/trunk-test-integration/docs/manual/mod/core.html.en
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/trunk-test-integration/docs/manual/mod/core.html.en?rev=1777707&r1=1777706&r2=1777707&view=diff
==============================================================================
--- httpd/httpd/branches/trunk-test-integration/docs/manual/mod/core.html.en (original)
+++ httpd/httpd/branches/trunk-test-integration/docs/manual/mod/core.html.en Fri Jan  6 19:55:46 2017
@@ -887,7 +887,7 @@ DocumentRoot "/var/www/${servername}/htd
 
     <p>While this directive is supported in virtual host context,
        the changes it makes are visible to any later configuration
-       directives, beyond any enclosing virtual host</p>
+       directives, beyond any enclosing virtual host.</p>
 
 </div>
 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>

Modified: httpd/httpd/branches/trunk-test-integration/docs/manual/mod/core.xml.de
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/trunk-test-integration/docs/manual/mod/core.xml.de?rev=1777707&r1=1777706&r2=1777707&view=diff
==============================================================================
--- httpd/httpd/branches/trunk-test-integration/docs/manual/mod/core.xml.de (original)
+++ httpd/httpd/branches/trunk-test-integration/docs/manual/mod/core.xml.de Fri Jan  6 19:55:46 2017
@@ -1,7 +1,7 @@
 <?xml version="1.0"?>
 <!DOCTYPE modulesynopsis SYSTEM "../style/modulesynopsis.dtd">
 <?xml-stylesheet type="text/xsl" href="../style/manual.de.xsl"?>
-<!-- English Revision: 344972:1777140 (outdated) -->
+<!-- English Revision: 344972:1777163 (outdated) -->
 
 <!--
  Licensed to the Apache Software Foundation (ASF) under one or more

Modified: httpd/httpd/branches/trunk-test-integration/docs/manual/mod/core.xml.es
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/trunk-test-integration/docs/manual/mod/core.xml.es?rev=1777707&r1=1777706&r2=1777707&view=diff
==============================================================================
--- httpd/httpd/branches/trunk-test-integration/docs/manual/mod/core.xml.es [utf-8] (original)
+++ httpd/httpd/branches/trunk-test-integration/docs/manual/mod/core.xml.es [utf-8] Fri Jan  6 19:55:46 2017
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="utf-8"?>
 <!DOCTYPE modulesynopsis SYSTEM "../style/modulesynopsis.dtd">
 <?xml-stylesheet type="text/xsl" href="../style/manual.es.xsl"?>
-<!-- English Revision: 1741251:1777140 (outdated) -->
+<!-- English Revision: 1741251:1777163 (outdated) -->
 <!-- Translated by Luis Gil de Bernab� Pfeiffer lgilbernabe[AT]apache.org -->
 <!-- Reviewed by Sergio Ramos-->
 <!--

Modified: httpd/httpd/branches/trunk-test-integration/docs/manual/mod/core.xml.fr
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/trunk-test-integration/docs/manual/mod/core.xml.fr?rev=1777707&r1=1777706&r2=1777707&view=diff
==============================================================================
--- httpd/httpd/branches/trunk-test-integration/docs/manual/mod/core.xml.fr [utf-8] (original)
+++ httpd/httpd/branches/trunk-test-integration/docs/manual/mod/core.xml.fr [utf-8] Fri Jan  6 19:55:46 2017
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8" ?>
 <!DOCTYPE modulesynopsis SYSTEM "../style/modulesynopsis.dtd">
 <?xml-stylesheet type="text/xsl" href="../style/manual.fr.xsl"?>
-<!-- English Revision: 1769718:1777140 (outdated) -->
+<!-- English Revision: 1769718:1777163 (outdated) -->
 <!-- French translation : Lucien GENTIS -->
 <!-- Reviewed by : Vincent Deffontaines -->
 

Modified: httpd/httpd/branches/trunk-test-integration/docs/manual/mod/core.xml.ja
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/trunk-test-integration/docs/manual/mod/core.xml.ja?rev=1777707&r1=1777706&r2=1777707&view=diff
==============================================================================
--- httpd/httpd/branches/trunk-test-integration/docs/manual/mod/core.xml.ja [utf-8] (original)
+++ httpd/httpd/branches/trunk-test-integration/docs/manual/mod/core.xml.ja [utf-8] Fri Jan  6 19:55:46 2017
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8" ?>
 <!DOCTYPE modulesynopsis SYSTEM "../style/modulesynopsis.dtd">
 <?xml-stylesheet type="text/xsl" href="../style/manual.ja.xsl"?>
-<!-- English Revision: 669847:1777140 (outdated) -->
+<!-- English Revision: 669847:1777163 (outdated) -->
 
 <!--
  Licensed to the Apache Software Foundation (ASF) under one or more

Modified: httpd/httpd/branches/trunk-test-integration/docs/manual/mod/core.xml.tr
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/trunk-test-integration/docs/manual/mod/core.xml.tr?rev=1777707&r1=1777706&r2=1777707&view=diff
==============================================================================
--- httpd/httpd/branches/trunk-test-integration/docs/manual/mod/core.xml.tr [utf-8] (original)
+++ httpd/httpd/branches/trunk-test-integration/docs/manual/mod/core.xml.tr [utf-8] Fri Jan  6 19:55:46 2017
@@ -1,7 +1,7 @@
 <?xml version="1.0"?>
 <!DOCTYPE modulesynopsis SYSTEM "../style/modulesynopsis.dtd">
 <?xml-stylesheet type="text/xsl" href="../style/manual.tr.xsl"?>
-<!-- English Revision: 1302855:1777140 (outdated) -->
+<!-- English Revision: 1302855:1777163 (outdated) -->
 <!-- =====================================================
  Translated by: Nilg�n Belma Bug�ner <nilgun belgeler.org>
    Reviewed by: Orhan Berent <berent belgeler.org>

Modified: httpd/httpd/branches/trunk-test-integration/docs/manual/mod/mod_http2.html.en
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/trunk-test-integration/docs/manual/mod/mod_http2.html.en?rev=1777707&r1=1777706&r2=1777707&view=diff
==============================================================================
--- httpd/httpd/branches/trunk-test-integration/docs/manual/mod/mod_http2.html.en (original)
+++ httpd/httpd/branches/trunk-test-integration/docs/manual/mod/mod_http2.html.en Fri Jan  6 19:55:46 2017
@@ -465,9 +465,7 @@
 </table>
             <p>
                 This directive toggles the usage of the HTTP/2 server push 
-                protocol feature. This should be used inside a 
-                <code class="directive"><a href="../mod/core.html#virtualhost">&lt;VirtualHost&gt;</a></code> 
-                section to enable direct HTTP/2 communication for that virtual host. 
+                protocol feature.
             </p>
             <p>
                 The HTTP/2 protocol allows the server to push other resources to

Modified: httpd/httpd/branches/trunk-test-integration/docs/manual/mod/mod_http2.xml
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/trunk-test-integration/docs/manual/mod/mod_http2.xml?rev=1777707&r1=1777706&r2=1777707&view=diff
==============================================================================
--- httpd/httpd/branches/trunk-test-integration/docs/manual/mod/mod_http2.xml (original)
+++ httpd/httpd/branches/trunk-test-integration/docs/manual/mod/mod_http2.xml Fri Jan  6 19:55:46 2017
@@ -268,9 +268,7 @@ H2Direct on
         <usage>
             <p>
                 This directive toggles the usage of the HTTP/2 server push 
-                protocol feature. This should be used inside a 
-                <directive module="core" type="section">VirtualHost</directive> 
-                section to enable direct HTTP/2 communication for that virtual host. 
+                protocol feature.
             </p>
             <p>
                 The HTTP/2 protocol allows the server to push other resources to

Modified: httpd/httpd/branches/trunk-test-integration/include/httpd.h
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/trunk-test-integration/include/httpd.h?rev=1777707&r1=1777706&r2=1777707&view=diff
==============================================================================
--- httpd/httpd/branches/trunk-test-integration/include/httpd.h (original)
+++ httpd/httpd/branches/trunk-test-integration/include/httpd.h Fri Jan  6 19:55:46 2017
@@ -690,6 +690,7 @@ struct ap_method_list_t {
 #endif /* APR_CHARSET_EBCDIC */
 /** Useful for common code with either platform charset. */
 #define CRLF_ASCII "\015\012"
+#define ZERO_ASCII "\060"
 
 /**
  * @defgroup values_request_rec_body Possible values for request_rec.read_body

Modified: httpd/httpd/branches/trunk-test-integration/modules/cache/cache_util.c
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/trunk-test-integration/modules/cache/cache_util.c?rev=1777707&r1=1777706&r2=1777707&view=diff
==============================================================================
--- httpd/httpd/branches/trunk-test-integration/modules/cache/cache_util.c (original)
+++ httpd/httpd/branches/trunk-test-integration/modules/cache/cache_util.c Fri Jan  6 19:55:46 2017
@@ -640,7 +640,7 @@ int cache_check_freshness(cache_handle_t
 
     /* extract max-stale */
     if (cache->control_in.max_stale) {
-        if(cache->control_in.max_stale_value != -1) {
+        if (cache->control_in.max_stale_value != -1) {
             maxstale = cache->control_in.max_stale_value;
         }
         else {
@@ -809,7 +809,7 @@ CACHE_DECLARE(const char *)ap_cache_toks
 
     *str = s;
     if (i)
-        return apr_pstrndup(p, list, i);
+        return apr_pstrmemdup(p, list, i);
     else
         return NULL;
 }
@@ -1141,7 +1141,6 @@ static int cache_control_remove(request_
                         }
                         found = 1;
                     }
-                    break;
                 }
                 break;
             }

Modified: httpd/httpd/branches/trunk-test-integration/modules/http/chunk_filter.c
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/trunk-test-integration/modules/http/chunk_filter.c?rev=1777707&r1=1777706&r2=1777707&view=diff
==============================================================================
--- httpd/httpd/branches/trunk-test-integration/modules/http/chunk_filter.c (original)
+++ httpd/httpd/branches/trunk-test-integration/modules/http/chunk_filter.c Fri Jan  6 19:55:46 2017
@@ -46,8 +46,6 @@ static char bad_gateway_seen;
 
 apr_status_t ap_http_chunk_filter(ap_filter_t *f, apr_bucket_brigade *b)
 {
-#define ASCII_CRLF  "\015\012"
-#define ASCII_ZERO  "\060"
     conn_rec *c = f->r->connection;
     apr_bucket_brigade *more, *tmp;
     apr_bucket *e;
@@ -144,7 +142,7 @@ apr_status_t ap_http_chunk_filter(ap_fil
              * Insert the end-of-chunk CRLF before an EOS or
              * FLUSH bucket, or appended to the brigade
              */
-            e = apr_bucket_immortal_create(ASCII_CRLF, 2, c->bucket_alloc);
+            e = apr_bucket_immortal_create(CRLF_ASCII, 2, c->bucket_alloc);
             if (eos != NULL) {
                 APR_BUCKET_INSERT_BEFORE(eos, e);
             }
@@ -178,9 +176,9 @@ apr_status_t ap_http_chunk_filter(ap_fil
          */
         if (eos && !f->ctx) {
             /* XXX: (2) trailers ... does not yet exist */
-            e = apr_bucket_immortal_create(ASCII_ZERO ASCII_CRLF
+            e = apr_bucket_immortal_create(ZERO_ASCII CRLF_ASCII
                                            /* <trailers> */
-                                           ASCII_CRLF, 5, c->bucket_alloc);
+                                           CRLF_ASCII, 5, c->bucket_alloc);
             APR_BUCKET_INSERT_BEFORE(eos, e);
         }
 

Modified: httpd/httpd/branches/trunk-test-integration/modules/http/http_filters.c
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/trunk-test-integration/modules/http/http_filters.c?rev=1777707&r1=1777706&r2=1777707&view=diff
==============================================================================
--- httpd/httpd/branches/trunk-test-integration/modules/http/http_filters.c (original)
+++ httpd/httpd/branches/trunk-test-integration/modules/http/http_filters.c Fri Jan  6 19:55:46 2017
@@ -635,10 +635,11 @@ struct check_header_ctx {
 };
 
 /* check a single header, to be used with apr_table_do() */
-static int check_header(void *arg, const char *name, const char *val)
+static int check_header(struct check_header_ctx *ctx,
+                        const char *name, const char **val)
 {
-    struct check_header_ctx *ctx = arg;
-    const char *test;
+    const char *pos, *end;
+    char *dst = NULL;
 
     if (name[0] == '\0') {
         ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, ctx->r, APLOGNO(02428)
@@ -647,12 +648,12 @@ static int check_header(void *arg, const
     }
 
     if (ctx->strict) { 
-        test = ap_scan_http_token(name);
+        end = ap_scan_http_token(name);
     }
     else {
-        test = ap_scan_vchar_obstext(name);
+        end = ap_scan_vchar_obstext(name);
     }
-    if (*test) {
+    if (*end) {
         ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, ctx->r, APLOGNO(02429)
                       "Response header name '%s' contains invalid "
                       "characters, aborting request",
@@ -660,13 +661,51 @@ static int check_header(void *arg, const
         return 0;
     }
 
-    test = ap_scan_http_field_content(val);
-    if (*test) {
-        ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, ctx->r, APLOGNO(02430)
-                      "Response header '%s' value of '%s' contains invalid "
-                      "characters, aborting request",
-                      name, val);
-        return 0;
+    for (pos = *val; *pos; pos = end) {
+        end = ap_scan_http_field_content(pos);
+        if (*end) {
+            if (end[0] != CR || end[1] != LF || (end[2] != ' ' &&
+                                                 end[2] != '\t')) {
+                ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, ctx->r, APLOGNO(02430)
+                              "Response header '%s' value of '%s' contains "
+                              "invalid characters, aborting request",
+                              name, pos);
+                return 0;
+            }
+            if (!dst) {
+                *val = dst = apr_palloc(ctx->r->pool, strlen(*val) + 1);
+            }
+        }
+        if (dst) {
+            memcpy(dst, pos, end - pos);
+            dst += end - pos;
+            if (*end) {
+                /* skip folding and replace with a single space */
+                end += 3 + strspn(end + 3, "\t ");
+                *dst++ = ' ';
+            }
+        }
+    }
+    if (dst) {
+        *dst = '\0';
+    }
+    return 1;
+}
+
+static int check_headers_table(apr_table_t *t, struct check_header_ctx *ctx)
+{
+    const apr_array_header_t *headers = apr_table_elts(t);
+    apr_table_entry_t *header;
+    int i;
+
+    for (i = 0; i < headers->nelts; ++i) {
+        header = &APR_ARRAY_IDX(headers, i, apr_table_entry_t);
+        if (!header->key) {
+            continue;
+        }
+        if (!check_header(ctx, header->key, (const char **)&header->val)) {
+            return 0;
+        }
     }
     return 1;
 }
@@ -683,8 +722,8 @@ static APR_INLINE int check_headers(requ
 
     ctx.r = r;
     ctx.strict = (conf->http_conformance != AP_HTTP_CONFORMANCE_UNSAFE);
-    return apr_table_do(check_header, &ctx, r->headers_out, NULL) &&
-           apr_table_do(check_header, &ctx, r->err_headers_out, NULL);
+    return check_headers_table(r->headers_out, &ctx) &&
+           check_headers_table(r->err_headers_out, &ctx);
 }
 
 static int check_headers_recursion(request_rec *r)

Modified: httpd/httpd/branches/trunk-test-integration/modules/proxy/config.m4
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/trunk-test-integration/modules/proxy/config.m4?rev=1777707&r1=1777706&r2=1777707&view=diff
==============================================================================
--- httpd/httpd/branches/trunk-test-integration/modules/proxy/config.m4 (original)
+++ httpd/httpd/branches/trunk-test-integration/modules/proxy/config.m4 Fri Jan  6 19:55:46 2017
@@ -5,20 +5,6 @@ APACHE_MODPATH_INIT(proxy)
 proxy_objs="mod_proxy.lo proxy_util.lo"
 APACHE_MODULE(proxy, Apache proxy module, $proxy_objs, , most)
 
-dnl set aside module selections and default, and set the module default to the
-dnl same scope (shared|static) as selected for mod proxy, along with setting
-dnl the default selection to "most" for remaining proxy modules, mirroring the
-dnl behavior of 2.4.1 and later, but failing ./configure only if an explicitly
-dnl enabled module is missing its prereqs
-save_module_selection=$module_selection
-save_module_default=$module_default
-if test "x$enable_proxy" != "xno"; then
-    module_selection=most
-    if test "$enable_proxy" = "shared" -o "$enable_proxy" = "static"; then
-        module_default=$enable_proxy
-    fi
-fi
-
 proxy_connect_objs="mod_proxy_connect.lo"
 proxy_ftp_objs="mod_proxy_ftp.lo"
 proxy_http_objs="mod_proxy_http.lo"
@@ -78,8 +64,5 @@ APACHE_MODULE(proxy_hcheck, [reverse-pro
 
 APR_ADDTO(INCLUDES, [-I\$(top_srcdir)/$modpath_current])
 
-module_selection=$save_module_selection
-module_default=$save_module_default
-
 APACHE_MODPATH_FINISH
 

Modified: httpd/httpd/branches/trunk-test-integration/modules/proxy/mod_proxy_http.c
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/trunk-test-integration/modules/proxy/mod_proxy_http.c?rev=1777707&r1=1777706&r2=1777707&view=diff
==============================================================================
--- httpd/httpd/branches/trunk-test-integration/modules/proxy/mod_proxy_http.c (original)
+++ httpd/httpd/branches/trunk-test-integration/modules/proxy/mod_proxy_http.c Fri Jan  6 19:55:46 2017
@@ -213,16 +213,13 @@ static void add_cl(apr_pool_t *p,
     APR_BRIGADE_INSERT_TAIL(header_brigade, e);
 }
 
-#define ASCII_CRLF  "\015\012"
-#define ASCII_ZERO  "\060"
-
 static void terminate_headers(apr_bucket_alloc_t *bucket_alloc,
                               apr_bucket_brigade *header_brigade)
 {
     apr_bucket *e;
 
     /* add empty line at the end of the headers */
-    e = apr_bucket_immortal_create(ASCII_CRLF, 2, bucket_alloc);
+    e = apr_bucket_immortal_create(CRLF_ASCII, 2, bucket_alloc);
     APR_BRIGADE_INSERT_TAIL(header_brigade, e);
 }
 
@@ -281,7 +278,7 @@ static int stream_reqbody_chunked(apr_po
             /*
              * Append the end-of-chunk CRLF
              */
-            e = apr_bucket_immortal_create(ASCII_CRLF, 2, bucket_alloc);
+            e = apr_bucket_immortal_create(CRLF_ASCII, 2, bucket_alloc);
             APR_BRIGADE_INSERT_TAIL(input_brigade, e);
         }
 
@@ -357,14 +354,14 @@ static int stream_reqbody_chunked(apr_po
         bb = input_brigade;
     }
 
-    e = apr_bucket_immortal_create(ASCII_ZERO ASCII_CRLF
+    e = apr_bucket_immortal_create(ZERO_ASCII CRLF_ASCII
                                    /* <trailers> */
-                                   ASCII_CRLF,
+                                   CRLF_ASCII,
                                    5, bucket_alloc);
     APR_BRIGADE_INSERT_TAIL(bb, e);
 
     if (apr_table_get(r->subprocess_env, "proxy-sendextracrlf")) {
-        e = apr_bucket_immortal_create(ASCII_CRLF, 2, bucket_alloc);
+        e = apr_bucket_immortal_create(CRLF_ASCII, 2, bucket_alloc);
         APR_BRIGADE_INSERT_TAIL(bb, e);
     }
 
@@ -426,7 +423,7 @@ static int stream_reqbody_cl(apr_pool_t
                 apr_bucket_delete(e);
 
                 if (apr_table_get(r->subprocess_env, "proxy-sendextracrlf")) {
-                    e = apr_bucket_immortal_create(ASCII_CRLF, 2,
+                    e = apr_bucket_immortal_create(CRLF_ASCII, 2,
                                                    bucket_alloc);
                     APR_BRIGADE_INSERT_TAIL(input_brigade, e);
                 }
@@ -665,7 +662,7 @@ static int spool_reqbody_cl(apr_pool_t *
         apr_brigade_insert_file(header_brigade, tmpfile, 0, fsize, p);
     }
     if (apr_table_get(r->subprocess_env, "proxy-sendextracrlf")) {
-        e = apr_bucket_immortal_create(ASCII_CRLF, 2, bucket_alloc);
+        e = apr_bucket_immortal_create(CRLF_ASCII, 2, bucket_alloc);
         APR_BRIGADE_INSERT_TAIL(header_brigade, e);
     }
     return OK;

Modified: httpd/httpd/branches/trunk-test-integration/server/protocol.c
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/trunk-test-integration/server/protocol.c?rev=1777707&r1=1777706&r2=1777707&view=diff
==============================================================================
--- httpd/httpd/branches/trunk-test-integration/server/protocol.c (original)
+++ httpd/httpd/branches/trunk-test-integration/server/protocol.c Fri Jan  6 19:55:46 2017
@@ -2080,12 +2080,26 @@ typedef struct hdr_ptr {
     apr_bucket_brigade *bb;
 } hdr_ptr;
 
+ 
+#if APR_CHARSET_EBCDIC
 static int send_header(void *data, const char *key, const char *val)
 {
-    ap_fputstrs(((hdr_ptr*)data)->f, ((hdr_ptr*)data)->bb,
-                key, ": ", val, CRLF, NULL);
+    char *header_line = NULL;
+    hdr_ptr *hdr = (hdr_ptr*)data;
+
+    header_line = apr_pstrcat(hdr->bb->p, key, ": ", val, CRLF, NULL);
+    ap_xlate_proto_to_ascii(header_line, strlen(header_line));
+    ap_fputs(hdr->f, hdr->bb, header_line);
     return 1;
 }
+#else
+static int send_header(void *data, const char *key, const char *val)
+{
+     ap_fputstrs(((hdr_ptr*)data)->f, ((hdr_ptr*)data)->bb,
+                 key, ": ", val, CRLF, NULL);
+     return 1;
+ }
+#endif
 
 AP_DECLARE(void) ap_send_interim_response(request_rec *r, int send_headers)
 {

Modified: httpd/httpd/branches/trunk-test-integration/server/vhost.c
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/trunk-test-integration/server/vhost.c?rev=1777707&r1=1777706&r2=1777707&view=diff
==============================================================================
--- httpd/httpd/branches/trunk-test-integration/server/vhost.c (original)
+++ httpd/httpd/branches/trunk-test-integration/server/vhost.c Fri Jan  6 19:55:46 2017
@@ -907,7 +907,7 @@ static int matches_aliases(server_rec *s
     if (names) {
         char **name = (char **) names->elts;
         for (i = 0; i < names->nelts; ++i) {
-            if(!name[i]) continue;
+            if (!name[i]) continue;
             if (!strcasecmp(host, name[i]))
                 return 1;
         }
@@ -916,7 +916,7 @@ static int matches_aliases(server_rec *s
     if (names) {
         char **name = (char **) names->elts;
         for (i = 0; i < names->nelts; ++i) {
-            if(!name[i]) continue;
+            if (!name[i]) continue;
             if (!ap_strcasecmp_match(host, name[i]))
                 return 1;
         }
@@ -1163,7 +1163,7 @@ AP_DECLARE(void) ap_update_vhost_from_he
          */
         if (have_hostname_from_url && host_header != NULL) {
             const char *repl = construct_host_header(r, is_v6literal);
-            apr_table_set(r->headers_in, "Host", repl);
+            apr_table_setn(r->headers_in, "Host", repl);
             ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, APLOGNO(02417)
                           "Replacing host header '%s' with host '%s' given "
                           "in the request uri", host_header, repl);