Backport evhttp_connection_get_bufferevent to Libevent 2.0

Backport by Arno Bakker; original implementation in 8d3a8500f4
This commit is contained in:
Arno Bakker 2011-12-14 16:17:19 -05:00 committed by Nick Mathewson
parent 7bbf6ca771
commit da70fa705b
2 changed files with 12 additions and 0 deletions

6
http.c
View File

@ -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)

View File

@ -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