mirror of
https://github.com/libevent/libevent.git
synced 2025-01-31 09:12:55 +08:00
moved EVHTTP_ flags to http.c
This commit is contained in:
parent
a8cd11f90f
commit
a92ce7e111
20
http.c
20
http.c
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user