diff options
author | Stefan Eissing <icing@apache.org> | 2022-04-13 07:40:17 +0000 |
---|---|---|
committer | Stefan Eissing <icing@apache.org> | 2022-04-13 07:40:17 +0000 |
commit | fbb84e00fa53ca34b97f9acc4d024e512d4e6f23 (patch) | |
tree | 47249fbbc06ebbf64e767683f870c0d7dd14213f /include/http_protocol.h | |
parent | d150ca6f4e93622150fd4867e7f7c1eec0026acb (diff) | |
download | httpd-fbb84e00fa53ca34b97f9acc4d024e512d4e6f23.tar.gz |
Merge PR 311:
*) core/mod_http: use REQUEST meta buckets and a new HTTP/1.x specific
input filter to separate the handling for HTTP requests from the
handling of HTTP/1.x request parsing and checks.
A new HTTP1_REQUEST_IN filter installs itself on http/1.1 connections
before a request is being read. It generates either a REQUEST meta
bucket on success or an ERROR bucket with the proposed response status.
The core connection processing, relying on ap_read_request(), now expects
a REQUEST or ERROR bucket from the input filters and is agnostic to
specific HTTP versions and how they bring requests into the server.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1899799 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'include/http_protocol.h')
-rw-r--r-- | include/http_protocol.h | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/include/http_protocol.h b/include/http_protocol.h index a2113d99d3..4bfe4a8559 100644 --- a/include/http_protocol.h +++ b/include/http_protocol.h @@ -65,19 +65,33 @@ AP_DECLARE(request_rec *) ap_create_request(conn_rec *c); * @param c The current connection * @return The new request_rec */ -request_rec *ap_read_request(conn_rec *c); +AP_DECLARE(request_rec *) ap_read_request(conn_rec *c); /** - * Assign the method, uri and protocol to the request. + * Assign the method, uri and protocol (in HTTP/1.x the + * items from the first line) to the request. * @param r The current request * @param method the HTTP method * @param uri the request uri * @param protocol the request protocol * @return 1 on success, 0 on failure */ -AP_DECLARE(int) ap_assign_request(request_rec *r, - const char *method, const char *uri, - const char *protocol); +AP_DECLARE(int) ap_assign_request_line(request_rec *r, + const char *method, const char *uri, + const char *protocol); + +/** + * Parse a HTTP/1.x request line, validate and return the components + * @param r The current request + * @param line the line to parse + * @param pmethod the parsed method on success + * @param puri the parsed uri on success + * @param pprotocol the parsed protocol on success + * @return 1 on success, 0 on failure + */ +AP_DECLARE(int) ap_h1_tokenize_request_line( + request_rec *r, const char *line, + const char **pmethod, const char **puri, const char **pprotocol); /** * Parse and validate the request line. |