PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
[ start all new proposals below, under PATCHES PROPOSED. ]
- *) mod_proxy_hcheck: hcmethod now allow for HTTP/1.1 requests
- using GET11, HEAD11 and/or OPTIONS11.
- trunk revision:
- https://svn.apache.org/r1903744
- https://svn.apache.org/r1903745
- https://svn.apache.org/r1904642
- https://svn.apache.org/r1905646/1905669. (*)
- Backport version for 2.4.x of patch:
- svn merge works (* requires hand fixing)
- +1: jim, covener, rpluem
-
*) mod_dav: DAVlockDiscovery option to disable WebDAV lock discovery
This is a game changer for performances if client use PROPFIND a lot,
trunk patch: http://svn.apache.org/r1904638
<tr><th>Method</th><th>Description</th><th>Note</th></tr>
<tr><td>None</td><td>No dynamic health checking done</td><td></td></tr>
<tr><td>TCP</td><td>Check that a socket to the backend can be created: e.g. "are you up"</td><td></td></tr>
- <tr><td>OPTIONS</td><td>Send an <code>HTTP OPTIONS</code> request to the backend</td><td>*</td></tr>
- <tr><td>HEAD</td><td>Send an <code>HTTP HEAD</code> request to the backend</td><td>*</td></tr>
- <tr><td>GET</td><td>Send an <code>HTTP GET</code> request to the backend</td><td>*</td></tr>
+ <tr><td>OPTIONS</td><td>Send a <code>HTTP OPTIONS</code> request to the backend via <code>HTTP/1.0</code></td><td>*</td></tr>
+ <tr><td>HEAD</td><td>Send a <code>HTTP HEAD</code> request to the backend via <code>HTTP/1.0</code></td><td>*</td></tr>
+ <tr><td>GET</td><td>Send a <code>HTTP GET</code> request to the backend via <code>HTTP/1.0</code></td><td>*</td></tr>
+ <tr><td>OPTIONS11</td><td>Send a <code>HTTP OPTIONS</code> request to the backend via <code>HTTP/1.1</code></td><td>*</td></tr>
+ <tr><td>HEAD11</td><td>Send a <code>HTTP HEAD</code> request to the backend via <code>HTTP/1.1</code></td><td>*</td></tr>
+ <tr><td>GET11</td><td>Send a <code>HTTP GET</code> request to the backend via <code>HTTP/1.1</code></td><td>*</td></tr>
<!--
<tr><td>CPING</td><td><strong>AJP only</strong> Do <code>CPING/CPONG</code> check</td><td></td></tr>
<tr><td>PROVIDER</td><td>Name of <code>provider</code> to be used to check health</td><td></td></tr>
const char *method; /* Method string for the HTTP/AJP request */
const char *req; /* pre-formatted HTTP/AJP request */
proxy_worker *w; /* Pointer to the actual worker */
+ const char *protocol; /* HTTP 1.0 or 1.1? */
} wctx_t;
typedef struct {
*/
static request_rec *create_request_rec(apr_pool_t *p, server_rec *s,
proxy_balancer *balancer,
- const char *method)
+ const char *method,
+ const char *protocol)
{
request_rec *r;
else {
r->header_only = 0;
}
-
r->protocol = "HTTP/1.0";
r->proto_num = HTTP_VERSION(1, 0);
-
+ if ( protocol && (protocol[7] == '1') ) {
+ r->protocol = "HTTP/1.1";
+ r->proto_num = HTTP_VERSION(1, 1);
+ }
r->hostname = NULL;
return r;
{
char *req = NULL;
const char *method = NULL;
+ const char *protocol = NULL;
+
+ /* TODO: Fold into switch/case below? This seems more obvious */
+ if ( (hc->s->method == OPTIONS11) || (hc->s->method == HEAD11) || (hc->s->method == GET11) ) {
+ protocol = "HTTP/1.1";
+ } else {
+ protocol = "HTTP/1.0";
+ }
switch (hc->s->method) {
case OPTIONS:
+ case OPTIONS11:
method = "OPTIONS";
req = apr_psprintf(p,
- "OPTIONS * HTTP/1.0\r\n"
+ "OPTIONS * %s\r\n"
"Host: %s:%d\r\n"
- "\r\n",
+ "\r\n", protocol,
hc->s->hostname_ex, (int)hc->s->port);
break;
case HEAD:
+ case HEAD11:
method = "HEAD";
/* fallthru */
case GET:
+ case GET11:
if (!method) { /* did we fall thru? If not, we are GET */
method = "GET";
}
req = apr_psprintf(p,
- "%s %s%s%s HTTP/1.0\r\n"
+ "%s %s%s%s %s\r\n"
"Host: %s:%d\r\n"
"\r\n",
method,
(wctx->path ? wctx->path : ""),
(wctx->path && *hc->s->hcuri ? "/" : "" ),
(*hc->s->hcuri ? hc->s->hcuri : ""),
+ protocol,
hc->s->hostname_ex, (int)hc->s->port);
break;
}
wctx->req = req;
wctx->method = method;
+ wctx->protocol = protocol;
}
static proxy_worker *hc_get_hcworker(sctx_t *ctx, proxy_worker *worker,
if ((status = ap_proxy_connect_backend("HCCPING", backend, hc, ctx->s)) != OK) {
return backend_cleanup("HCCPING", backend, ctx->s, status);
}
- r = create_request_rec(ptemp, ctx->s, baton->balancer, "CPING");
+ r = create_request_rec(ptemp, ctx->s, baton->balancer, "CPING", NULL);
if ((status = ap_proxy_connection_create_ex("HCCPING", backend, r)) != OK) {
return backend_cleanup("HCCPING", backend, ctx->s, status);
}
return backend_cleanup("HCOH", backend, ctx->s, status);
}
- r = create_request_rec(ptemp, ctx->s, baton->balancer, wctx->method);
+ r = create_request_rec(ptemp, ctx->s, baton->balancer, wctx->method, wctx->protocol);
if ((status = ap_proxy_connection_create_ex("HCOH", backend, r)) != OK) {
return backend_cleanup("HCOH", backend, ctx->s, status);
}