]> granicus.if.org Git - libevent/commitdiff
Backport evhttp_connection_get_bufferevent to Libevent 2.0
authorArno Bakker <abakker@users.sourceforge.net>
Wed, 14 Dec 2011 21:17:19 +0000 (16:17 -0500)
committerNick Mathewson <nickm@torproject.org>
Wed, 14 Dec 2011 21:17:19 +0000 (16:17 -0500)
Backport by Arno Bakker; original implementation in 8d3a8500f4

http.c
include/event2/http.h

diff --git a/http.c b/http.c
index cc9b149a5c60f33db0f57b16649f75d1b380eada..8676c89bcb3884d02c348e23e745220ed537ffbe 100644 (file)
--- 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)
index cb21d46683088a2511dc53231add726460da31ad..d9f806e0c2b4951a1d85d8e00a92515f89b44258 100644 (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