THRIFT-4418: evhttp_connection_new is deprecated; use evhttp_connection_base_new
Client: C++
This closes #1438
diff --git a/lib/cpp/src/thrift/async/TEvhttpClientChannel.cpp b/lib/cpp/src/thrift/async/TEvhttpClientChannel.cpp
index 74acfaa..6af8104 100644
--- a/lib/cpp/src/thrift/async/TEvhttpClientChannel.cpp
+++ b/lib/cpp/src/thrift/async/TEvhttpClientChannel.cpp
@@ -38,13 +38,14 @@
const std::string& path,
const char* address,
int port,
- struct event_base* eb)
+ struct event_base* eb,
+ struct evdns_base* dnsbase)
+
: host_(host), path_(path), conn_(NULL) {
- conn_ = evhttp_connection_new(address, port);
+ conn_ = evhttp_connection_base_new(eb, dnsbase, address, port);
if (conn_ == NULL) {
throw TException("evhttp_connection_new failed");
}
- evhttp_connection_set_base(conn_, eb);
}
TEvhttpClientChannel::~TEvhttpClientChannel() {
diff --git a/lib/cpp/src/thrift/async/TEvhttpClientChannel.h b/lib/cpp/src/thrift/async/TEvhttpClientChannel.h
index 9774952..3515ca2 100644
--- a/lib/cpp/src/thrift/async/TEvhttpClientChannel.h
+++ b/lib/cpp/src/thrift/async/TEvhttpClientChannel.h
@@ -27,6 +27,7 @@
#include <thrift/async/TAsyncChannel.h>
struct event_base;
+struct evdns_base;
struct evhttp_connection;
struct evhttp_request;
@@ -50,7 +51,8 @@
const std::string& path,
const char* address,
int port,
- struct event_base* eb);
+ struct event_base* eb,
+ struct evdns_base *dnsbase = 0);
~TEvhttpClientChannel();
virtual void sendAndRecvMessage(const VoidCallback& cob,