summaryrefslogtreecommitdiff
path: root/http-internal.h
diff options
context:
space:
mode:
authorThomas Bernard <miniupnp@free.fr>2016-01-08 13:36:20 -0800
committerAzat Khuzhin <azat@libevent.org>2019-04-11 22:48:01 +0300
commit8dcb94a4ca0999bdada6baa2a986f4c00a922060 (patch)
tree3c664863b663ae3cbf8be24af903de6a9ae00c55 /http-internal.h
parent96e56beb9426df17d9a75483f7c6b438a6577cf4 (diff)
downloadlibevent-8dcb94a4ca0999bdada6baa2a986f4c00a922060.tar.gz
Added http method extending
User can define his own response method by calling evhttp_set_ext_method_cmp() on the struct http, or evhttp_connection_set_ext_method_cmp() on the connection. We expose a new stucture `evhttp_ext_method` which is passed to the callback if it's set. So any field can be modified, with some exceptions (in evhttp_method_): If the cmp function is set, it has the ability to modify method, and flags. Other fields will be ignored. Flags returned are OR'd with the current flags. Based on changes to the #282 from: Mark Ellzey <socket@gmail.com>
Diffstat (limited to 'http-internal.h')
-rw-r--r--http-internal.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/http-internal.h b/http-internal.h
index 72016a01..3bf16b5b 100644
--- a/http-internal.h
+++ b/http-internal.h
@@ -105,6 +105,8 @@ struct evhttp_connection {
struct event_base *base;
struct evdns_base *dns_base;
int ai_family;
+
+ evhttp_ext_method_cb ext_method_cmp;
};
/* A callback for an http server */
@@ -175,6 +177,8 @@ struct evhttp {
void *newreqcbarg;
struct event_base *base;
+
+ evhttp_ext_method_cb ext_method_cmp;
};
/* XXX most of these functions could be static. */