headers: unify API across build options

This commit is contained in:
Adrien Béraud committed 2018-01-31 18:07:43 +01:00
1 parent bd9496e2ba
commit e274ffd83b
8 files changed
+67 -90

No files matched your search

+7 -9
View File
@@ -37,19 +37,17 @@ using namespace std::placeholders;
namespace dht {
DhtProxyServer::DhtProxyServer(std::shared_ptr<DhtRunner> dht, in_port_t port
#if OPENDHT_PUSH_NOTIFICATIONS
, const std::string& pushServer
#endif // OPENDHT_PUSH_NOTIFICATIONS
)
: dht_(dht)
#if OPENDHT_PUSH_NOTIFICATIONS
, pushServer_(pushServer)
#endif // OPENDHT_PUSH_NOTIFICATIONS
DhtProxyServer::DhtProxyServer(std::shared_ptr<DhtRunner> dht, in_port_t port , const std::string& pushServer)
: dht_(dht) , pushServer_(pushServer)
{
// NOTE in c++14, use make_unique
service_ = std::unique_ptr<restbed::Service>(new restbed::Service());
#if !OPENDHT_PUSH_NOTIFICATIONS
if (not pushServer.empty())
std::cerr << "Push server defined but built OpenDHT built without push notification support" << std::endl;
#endif
server_thread = std::thread([this, port]() {
// Create endpoints
auto resource = std::make_shared<restbed::Resource>();