-*- 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)]
* 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:
<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>
<?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
<?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-->
<!--
<?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 -->
<?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
<?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>
</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"><VirtualHost></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
<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
#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
/* 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 {
*str = s;
if (i)
- return apr_pstrndup(p, list, i);
+ return apr_pstrmemdup(p, list, i);
else
return NULL;
}
}
found = 1;
}
- break;
}
break;
}
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;
* 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);
}
*/
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);
}
};
/* 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)
}
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",
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;
}
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)
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"
APR_ADDTO(INCLUDES, [-I\$(top_srcdir)/$modpath_current])
-module_selection=$save_module_selection
-module_default=$save_module_default
-
APACHE_MODPATH_FINISH
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);
}
/*
* 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);
}
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);
}
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);
}
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;
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)
{
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;
}
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;
}
*/
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);