1
0
mirror of https://github.com/apache/httpd.git synced 2025-08-07 04:02:58 +03:00

mod_http2: support for intermediate responses

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1755323 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Stefan Eissing
2016-08-05 13:48:16 +00:00
parent c91bbae4d0
commit 8b0d436788
15 changed files with 233 additions and 80 deletions

View File

@@ -247,7 +247,8 @@ h2_request *h2_request_clone(apr_pool_t *p, const h2_request *src)
request_rec *h2_request_create_rec(const h2_request *req, conn_rec *c)
{
int access_status = HTTP_OK;
const char *expect;
request_rec *r = ap_create_request(c);
r->headers_in = apr_table_clone(r->pool, req->headers);
@@ -281,6 +282,18 @@ request_rec *h2_request_create_rec(const h2_request *req, conn_rec *c)
/* we may have switched to another server */
r->per_dir_config = r->server->lookup_defaults;
if (r && ((expect = apr_table_get(r->headers_in, "Expect")) != NULL)
&& (expect[0] != '\0')) {
if (ap_cstr_casecmp(expect, "100-continue") == 0) {
r->expecting_100 = 1;
ap_add_input_filter("H2_CONTINUE", NULL, r, c);
}
else {
r->status = HTTP_EXPECTATION_FAILED;
ap_send_error_response(r, 0);
}
}
/*
* Add the HTTP_IN filter here to ensure that ap_discard_request_body
* called by ap_die and by ap_send_error_response works correctly on
@@ -304,7 +317,7 @@ request_rec *h2_request_create_rec(const h2_request *req, conn_rec *c)
r = NULL;
goto traceout;
}
AP_READ_REQUEST_SUCCESS((uintptr_t)r, (char *)r->method,
(char *)r->uri, (char *)r->server->defn_name,
r->status);