diff --git a/src/dht_proxy_client.cpp b/src/dht_proxy_client.cpp index 58a988d2..c70edd1d 100644 --- a/src/dht_proxy_client.cpp +++ b/src/dht_proxy_client.cpp @@ -47,6 +47,8 @@ do_request(const std::string & request, const std::string & addr, std::uint16_t // write request restinio::asio_ns::streambuf b; std::ostream req_stream(&b); + // TODO log + std::cout << "sending client request:\n" << request.c_str() << std::endl; req_stream << request; restinio::asio_ns::write(socket, b); // read response diff --git a/src/dht_proxy_server.cpp b/src/dht_proxy_server.cpp index 183b5827..253d6e20 100644 --- a/src/dht_proxy_server.cpp +++ b/src/dht_proxy_server.cpp @@ -575,7 +575,6 @@ DhtProxyServer::sendPushNotification(const std::string& token, Json::Value&& jso { if (pushServer_.empty()) return; - http_parser_settings settings; http_parser_settings_init(&settings); settings.on_status = []( http_parser * parser, const char * at, size_t length ) -> int { @@ -618,10 +617,9 @@ DhtProxyServer::sendPushNotification(const std::string& token, Json::Value&& jso auto request = restinio::client::create_http_request( header, header_fields, restinio::http_connection_header_t::close, body); - std::string addr = pushServer_.substr(0, pushServer_.find(":")); - uint16_t port = std::atoi(pushServer_.substr(pushServer_.find(":")).c_str()); - - restinio::client::do_request(request, addr, port, settings); + // TODO move pushServer ip,port parsing supporting ipv6 to constructor + uint16_t port = std::atoi(pushServer_.c_str()); + restinio::client::do_request(request, "127.0.0.1", port, settings); } #endif //OPENDHT_PUSH_NOTIFICATIONS