From 18e53b9ec83bf41f4b08431fe7e99a8bfaf6cd1f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C3=A9bastien=20Blin?=
 <sebastien.blin@savoirfairelinux.com>
Date: Thu, 15 Sep 2022 11:19:29 -0400
Subject: [PATCH] proxyserver: send correct value id to client

when searching for a value to put, the proxy server returned
a json with value->id = 0, causing the client to not refreshing
correctly the values later (when timeout-ing, the value to refresh
is not found).
---
 src/dht_proxy_server.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/dht_proxy_server.cpp b/src/dht_proxy_server.cpp
index 0ea70d4d..59eb7e53 100644
--- a/src/dht_proxy_server.cpp
+++ b/src/dht_proxy_server.cpp
@@ -1176,7 +1176,7 @@ DhtProxyServer::put(restinio::request_handle_t request,
                                 }
                             }
                             auto response = initHttpResponse(request->create_response());
-                            response.append_body(Json::writeString(jsonBuilder_, value->toJson()) + "\n");
+                            response.append_body(Json::writeString(jsonBuilder_, pp.second.value->toJson()) + "\n");
                             return response.done();
                         }
                     }
-- 
GitLab