From a57767faf8d140797b0adf3fe885b7eb8928057c Mon Sep 17 00:00:00 2001 From: Niels Provos Date: Sun, 11 May 2008 16:22:35 +0000 Subject: [PATCH] more accessors for evhttp_request svn:r807 --- http.c | 25 +++++++++++++++++++++++++ include/event2/http.h | 8 ++++++++ 2 files changed, 33 insertions(+) diff --git a/http.c b/http.c index a6fd4fdf..3ae82b85 100644 --- a/http.c +++ b/http.c @@ -2356,6 +2356,31 @@ evhttp_request_get_uri(struct evhttp_request *req) { return (req->uri); } +/** Returns the input headers */ +struct evkeyvalq *evhttp_request_get_input_headers(struct evhttp_request *req) +{ + return (req->input_headers); +} + +/** Returns the output headers */ +struct evkeyvalq *evhttp_request_get_output_headers(struct evhttp_request *req) +{ + return (req->output_headers); +} + +/** Returns the input buffer */ +struct evbuffer *evhttp_request_get_input_buffer(struct evhttp_request *req) +{ + return (req->input_buffer); +} + +/** Returns the output buffer */ +struct evbuffer *evhttp_request_get_output_buffer(struct evhttp_request *req) +{ + return (req->output_buffer); +} + + /* * Takes a file descriptor to read a request from. * The callback is executed once the whole request has been read. diff --git a/include/event2/http.h b/include/event2/http.h index 60831f07..5b58e223 100644 --- a/include/event2/http.h +++ b/include/event2/http.h @@ -281,6 +281,14 @@ int evhttp_make_request(struct evhttp_connection *evcon, /** Returns the request URI */ const char *evhttp_request_get_uri(struct evhttp_request *req); +/** Returns the input headers */ +struct evkeyvalq *evhttp_request_get_input_headers(struct evhttp_request *req); +/** Returns the output headers */ +struct evkeyvalq *evhttp_request_get_output_headers(struct evhttp_request *req); +/** Returns the input buffer */ +struct evbuffer *evhttp_request_get_input_buffer(struct evhttp_request *req); +/** Returns the output buffer */ +struct evbuffer *evhttp_request_get_output_buffer(struct evhttp_request *req); /* Interfaces for dealing with HTTP headers */ -- 2.40.0