moved EVHTTP_ flags to http.c

This commit is contained in:
Kirill Rodriguez 2024-10-29 11:26:35 +00:00
parent a8cd11f90f
commit a92ce7e111
No known key found for this signature in database
GPG Key ID: 2AA85EC2AD7F85EA
2 changed files with 9 additions and 21 deletions

20
http.c
View File

@ -128,6 +128,15 @@
#define NI_NUMERICSERV 2 #define NI_NUMERICSERV 2
#endif #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 static int
fake_getnameinfo(const struct sockaddr *sa, size_t salen, char *host, fake_getnameinfo(const struct sockaddr *sa, size_t salen, char *host,
size_t hostlen, char *serv, size_t servlen, int flags) 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; return 0;
} }

View File

@ -67,16 +67,6 @@ struct {
/* the connection object that this request belongs to */ /* the connection object that this request belongs to */
struct evhttp_connection *evcon; struct evhttp_connection *evcon;
int flags; 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 *input_headers;
struct evkeyvalq *output_headers; struct evkeyvalq *output_headers;