mirror of
https://github.com/libevent/libevent.git
synced 2025-01-31 09:12:55 +08:00
Add evhttp_request_get_command so code can tell GET from POST without peeking at the struct.
This commit is contained in:
parent
e5870690fc
commit
49f4bf7c57
7
http.c
7
http.c
@ -3058,12 +3058,17 @@ evhttp_request_set_chunked_cb(struct evhttp_request *req,
|
||||
*/
|
||||
|
||||
const char *
|
||||
evhttp_request_get_uri(struct evhttp_request *req) {
|
||||
evhttp_request_get_uri(const struct evhttp_request *req) {
|
||||
if (req->uri == NULL)
|
||||
event_debug(("%s: request %p has no uri\n", __func__, req));
|
||||
return (req->uri);
|
||||
}
|
||||
|
||||
enum evhttp_cmd_type
|
||||
evhttp_request_get_command(const struct evhttp_request *req) {
|
||||
return (req->type);
|
||||
}
|
||||
|
||||
/** Returns the input headers */
|
||||
struct evkeyvalq *evhttp_request_get_input_headers(struct evhttp_request *req)
|
||||
{
|
||||
|
@ -450,7 +450,9 @@ void evhttp_cancel_request(struct evhttp_request *req);
|
||||
|
||||
|
||||
/** Returns the request URI */
|
||||
const char *evhttp_request_get_uri(struct evhttp_request *req);
|
||||
const char *evhttp_request_get_uri(const struct evhttp_request *req);
|
||||
/** Returns the request command */
|
||||
enum evhttp_cmd_type evhttp_request_get_command(const struct evhttp_request *req);
|
||||
/** Returns the input headers */
|
||||
struct evkeyvalq *evhttp_request_get_input_headers(struct evhttp_request *req);
|
||||
/** Returns the output headers */
|
||||
|
Loading…
x
Reference in New Issue
Block a user