From a92ce7e11146b0b57456c505c6d23e225d712e64 Mon Sep 17 00:00:00 2001 From: Kirill Rodriguez Date: Tue, 29 Oct 2024 11:26:35 +0000 Subject: [PATCH] moved EVHTTP_ flags to http.c --- http.c | 20 +++++++++----------- include/event2/http_struct.h | 10 ---------- 2 files changed, 9 insertions(+), 21 deletions(-) diff --git a/http.c b/http.c index 2e1ec583..2fb38103 100644 --- a/http.c +++ b/http.c @@ -128,6 +128,15 @@ #define NI_NUMERICSERV 2 #endif +/** The request obj owns the evhttp connection and needs to free it */ +#define EVHTTP_REQ_OWN_CONNECTION 0x0001 +/** The request object is owned by the user; the user must free it */ +#define EVHTTP_USER_OWNED 0x0004 +/** The request will be used again upstack; freeing must be deferred */ +#define EVHTTP_REQ_DEFER_FREE 0x0008 +/** The request should be freed upstack */ +#define EVHTTP_REQ_NEEDS_FREE 0x0010 + static int fake_getnameinfo(const struct sockaddr *sa, size_t salen, char *host, size_t hostlen, char *serv, size_t servlen, int flags) @@ -2048,17 +2057,6 @@ evhttp_parse_request_line(struct evhttp_request *req, char *line, size_t len) } } - /* If we have an absolute-URI, check to see if it is an http request - for a known vhost or server alias. If we don't know about this - host, we consider it a proxy request. */ - scheme = evhttp_uri_get_scheme(req->uri_elems); - hostname = evhttp_uri_get_host(req->uri_elems); - if (scheme && (!evutil_ascii_strcasecmp(scheme, "http") || - !evutil_ascii_strcasecmp(scheme, "https")) && - hostname && - !evhttp_find_vhost(req->evcon->http_server, NULL, hostname)) - req->flags |= EVHTTP_PROXY_REQUEST; - return 0; } diff --git a/include/event2/http_struct.h b/include/event2/http_struct.h index b828180e..d824a346 100644 --- a/include/event2/http_struct.h +++ b/include/event2/http_struct.h @@ -67,16 +67,6 @@ struct { /* the connection object that this request belongs to */ struct evhttp_connection *evcon; int flags; -/** The request obj owns the evhttp connection and needs to free it */ -#define EVHTTP_REQ_OWN_CONNECTION 0x0001 -/** Request was made via a proxy */ -#define EVHTTP_PROXY_REQUEST 0x0002 -/** The request object is owned by the user; the user must free it */ -#define EVHTTP_USER_OWNED 0x0004 -/** The request will be used again upstack; freeing must be deferred */ -#define EVHTTP_REQ_DEFER_FREE 0x0008 -/** The request should be freed upstack */ -#define EVHTTP_REQ_NEEDS_FREE 0x0010 struct evkeyvalq *input_headers; struct evkeyvalq *output_headers;