summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorLeon M. George <leon@georgemail.eu>2022-08-01 10:16:18 +0200
committerAzat Khuzhin <azat@libevent.org>2022-08-13 20:12:18 +0200
commit1bdc91350ee30d3aa51fe809fd719c2c3183b445 (patch)
tree7f0c51badd9293c101f206a874e1f437815011dc /include
parenta4cdc3c5e864c3ee4b836c78f92e07229be39c0f (diff)
downloadlibevent-1bdc91350ee30d3aa51fe809fd719c2c3183b445.tar.gz
http: allow setting bevcb per socket
Co-authored-by: Azat Khuzhin <azat@libevent.org> v2: remove handling of HTTP_BIND_IPV6
Diffstat (limited to 'include')
-rw-r--r--include/event2/http.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/event2/http.h b/include/event2/http.h
index 27cbd35e..50c0a27b 100644
--- a/include/event2/http.h
+++ b/include/event2/http.h
@@ -172,6 +172,14 @@ struct evhttp_bound_socket *evhttp_bind_listener(struct evhttp *http, struct evc
EVENT2_EXPORT_SYMBOL
struct evconnlistener *evhttp_bound_socket_get_listener(struct evhttp_bound_socket *bound);
+/*
+ * Like evhttp_set_bevcb.
+ * If cb returns a non-NULL bufferevent, * the callback supplied through
+ * evhttp_set_bevcb isn't used.
+ */
+EVENT2_EXPORT_SYMBOL
+void evhttp_bound_set_bevcb(struct evhttp_bound_socket *bound, struct bufferevent* (*cb)(struct event_base *, void *), void *cbarg);
+
typedef void evhttp_bound_socket_foreach_fn(struct evhttp_bound_socket *, void *);
/**
* Applies the function specified in the first argument to all
@@ -333,6 +341,8 @@ void evhttp_set_gencb(struct evhttp *http,
/**
Set a callback used to create new bufferevents for connections
to a given evhttp object.
+ cb is not called if a non-NULL bufferevent was supplied by
+ evhttp_bound_set_bevcb.
You can use this to override the default bufferevent type -- for example,
to make this evhttp object use SSL bufferevents rather than unencrypted