From bdfb0148e4dfe15deb41dbdadf3eb2bcaeb87f38 Mon Sep 17 00:00:00 2001 From: Seva Date: Wed, 3 Jul 2019 11:27:51 -0400 Subject: [PATCH] dhtproxy: use legacy listen route in client --- src/dht_proxy_client.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/dht_proxy_client.cpp b/src/dht_proxy_client.cpp index 79ce1007..ba40204a 100644 --- a/src/dht_proxy_client.cpp +++ b/src/dht_proxy_client.cpp @@ -853,8 +853,9 @@ DhtProxyClient::listen(const InfoHash& key, ValueCallback cb, Value::Filter filt restinio::http_request_header_t header; if (deviceKey_.empty()){ // listen method = ListenMethod::LISTEN; - header.method(restinio::http_method_get()); - header.request_target("/" + key.toString() + "/listen"); + header.method(restinio::custom_http_methods_t::from_nodejs( + restinio::method_listen.raw_id())); + header.request_target("/" + key.toString()); } else { method = ListenMethod::SUBSCRIBE; @@ -1170,8 +1171,9 @@ DhtProxyClient::restartListeners() auto cb = listener.cb; // define header restinio::http_request_header_t header; - header.method(restinio::http_method_get()); - header.request_target("/" + search.first.toString() + "/listen"); + header.method(restinio::custom_http_methods_t::from_nodejs( + restinio::method_listen.raw_id())); + header.request_target("/" + search.first.toString()); // send listen sendListen(header, cb, filter, state, listener, ListenMethod::LISTEN); }