From: Arno Bakker Date: Wed, 14 Dec 2011 21:17:19 +0000 (-0500) Subject: Backport evhttp_connection_get_bufferevent to Libevent 2.0 X-Git-Tag: release-2.0.17-stable~25 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=da70fa705bede0b39c8057c49cbd69fdc586df02;p=libevent Backport evhttp_connection_get_bufferevent to Libevent 2.0 Backport by Arno Bakker; original implementation in 8d3a8500f4 --- diff --git a/http.c b/http.c index cc9b149a..8676c89b 100644 --- a/http.c +++ b/http.c @@ -2117,6 +2117,12 @@ evhttp_connection_base_new(struct event_base *base, struct evdns_base *dnsbase, return (NULL); } +struct bufferevent * +evhttp_connection_get_bufferevent(struct evhttp_connection *evcon) +{ + return evcon->bufev; +} + void evhttp_connection_set_base(struct evhttp_connection *evcon, struct event_base *base) diff --git a/include/event2/http.h b/include/event2/http.h index cb21d466..d9f806e0 100644 --- a/include/event2/http.h +++ b/include/event2/http.h @@ -428,6 +428,12 @@ struct evhttp_connection *evhttp_connection_base_new( struct event_base *base, struct evdns_base *dnsbase, const char *address, unsigned short port); +/** + * Return the bufferevent that an evhttp_connection is using. + */ +struct bufferevent *evhttp_connection_get_bufferevent( + struct evhttp_connection *evcon); + /** Takes ownership of the request object * * Can be used in a request callback to keep onto the request until