]> granicus.if.org Git - apache/commitdiff
sync merge with trunk
authorJacob Champion <jchampion@apache.org>
Fri, 6 Jan 2017 19:55:46 +0000 (19:55 +0000)
committerJacob Champion <jchampion@apache.org>
Fri, 6 Jan 2017 19:55:46 +0000 (19:55 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/trunk-test-integration@1777707 13f79535-47bb-0310-9956-ffa450edef68

18 files changed:
CHANGES
STATUS
docs/manual/mod/core.html.en
docs/manual/mod/core.xml.de
docs/manual/mod/core.xml.es
docs/manual/mod/core.xml.fr
docs/manual/mod/core.xml.ja
docs/manual/mod/core.xml.tr
docs/manual/mod/mod_http2.html.en
docs/manual/mod/mod_http2.xml
include/httpd.h
modules/cache/cache_util.c
modules/http/chunk_filter.c
modules/http/http_filters.c
modules/proxy/config.m4
modules/proxy/mod_proxy_http.c
server/protocol.c
server/vhost.c

diff --git a/CHANGES b/CHANGES
index edea266b897d27ac0dc5aad4cf78bf79a4db99a0..97ee63418525e3710d8112b60e81793279ed421e 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -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)]
      
diff --git a/STATUS b/STATUS
index b048a9141f7dad64c3437ca351caba2ec083dd66..e40a8797f3e27e2e67ff1c63048cd74e78b13672 100644 (file)
--- a/STATUS
+++ b/STATUS
@@ -129,6 +129,24 @@ THINGS THAT SHOULD BE CONSIDERED EARLY IN THE 2.6/3.0 DEVELOPMENT CYCLE:
   * 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:
 
index 03c3fb712018f4ca2d0e58c6068d3e9dc4a62625..fdbf21e4ea82188e9d6ebc3aacfa0828dc797e39 100644 (file)
@@ -887,7 +887,7 @@ DocumentRoot "/var/www/${servername}/htdocs"</pre>
 
     <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>
index 42d7245556a98529f128194bc93492cbfffe9580..7778ffa6cf1b6b2efa735cd2403f9012771a8915 100644 (file)
@@ -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
index 7ae0d7a53d6da3de2c1c15adc43a986b0cfc7c1e..ec0d3d6c3ea8fc659e4f555913b4e76e77bb5708 100644 (file)
@@ -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-->
 <!--
index e29ae339c3a7a15f5549310cd915db42c19eda53..d404e03ec6e8976a881a739b7acc2917446933f0 100644 (file)
@@ -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 -->
 
index 1f400680a030dce21460f015df14985dd7106772..2f3fb3c9efabcf2679751c09b65b26a475a18a48 100644 (file)
@@ -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
index 3336085f9e0693e61e7813c5ca8cae6e82be684f..b8f100eba81a939b608436e61ae14954d4823fa6 100644 (file)
@@ -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>
index f30d8ad0e0415a7b5942169adb4cc66af0bd20f0..a4ca49be10beedc9969aea58a5eab71c6d0b5578 100644 (file)
 </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
index b7dcc959be883c8aa856742d041137f3a3fb642b..63bcf9f74ba008b38334079b1bcf4252f1f3c740 100644 (file)
@@ -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
index dec6706bd9e91fe572773a64e52b37c4f53f5542..ebb2a15b4cc9006cce3f250435430f134ed300fc 100644 (file)
@@ -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
index 096058308e037fa8f92be1ed31acdfa971383ae7..0074b10002cf1cd645d783ab291cf9f6921acc8d 100644 (file)
@@ -640,7 +640,7 @@ int cache_check_freshness(cache_handle_t *h, cache_request_rec *cache,
 
     /* 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_tokstr(apr_pool_t *p, const char *list,
 
     *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_rec *r, const char *cc_header,
                         }
                         found = 1;
                     }
-                    break;
                 }
                 break;
             }
index e8d347435703519514873918fc700799f254fbcd..6f5f7c153e0c5167b894b0ad639491f8e87cb150 100644 (file)
@@ -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_filter_t *f, apr_bucket_brigade *b)
              * 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_filter_t *f, apr_bucket_brigade *b)
          */
         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);
         }
 
index 195a2e127bb6ddd995521fa9a79c0d151ca2257d..5fa768e25b5a439b43ce4e7fa3f96ff15f96dba4 100644 (file)
@@ -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 char *name, const char *val)
     }
 
     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 char *name, const char *val)
         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(request_rec *r)
 
     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)
index 26cfb24a61bb8e37d881ee88a563623fb1b8380e..8b2f1b8cdd4ce5080076ebcc2e52b6a3bceedf8e 100644 (file)
@@ -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-proxy health-check module. Requires --enabl
 
 APR_ADDTO(INCLUDES, [-I\$(top_srcdir)/$modpath_current])
 
-module_selection=$save_module_selection
-module_default=$save_module_default
-
 APACHE_MODPATH_FINISH
 
index ae6384424c167419aba148209c0848b1d0575164..fc9c0440216fbdf5e807ae0eeb68ba68992f22f2 100644 (file)
@@ -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_pool_t *p,
             /*
              * 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_pool_t *p,
         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 *p,
                 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 *p,
         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;
index 410da0f14199a8f9a70473d20ddae885eb158a59..8cf5a7d48d7c0c1b100e8977ea6c99def1b103b8 100644 (file)
@@ -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)
 {
index c4bd846f7d9f5e0e5903d22113bbacb629ff030e..5ad4efd3817de1f117d70ceaf28c78de2251d031 100644 (file)
@@ -907,7 +907,7 @@ static int matches_aliases(server_rec *s, const char *host)
     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, const char *host)
     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_headers(request_rec *r)
          */
         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);