acelyc111 commented on code in PR #1198:
URL: 
https://github.com/apache/incubator-pegasus/pull/1198#discussion_r1036754298


##########
src/http/http_server.cpp:
##########
@@ -65,21 +81,38 @@ DSN_DEFINE_bool("http", enable_http_server, true, "whether 
to enable the embedde
     http_call_registry::instance().remove(full_path);
 }
 
-void http_service::register_handler(std::string path, http_callback cb, 
std::string help)
+void http_service::register_handler(std::string sub_path, http_callback cb, 
std::string help)
 {
+    CHECK(!sub_path.empty(), "");
     if (!FLAGS_enable_http_server) {
         return;
     }
     auto call = make_unique<http_call>();
-    call->path = this->path();
-    if (!path.empty()) {
-        call->path += "/" + std::move(path);
+    if (this->path().empty()) {
+        call->path = std::move(sub_path);
+    } else {
+        call->path = this->path() + "/" + std::move(sub_path);
     }
     call->callback = std::move(cb);
     call->help = std::move(help);
     http_call_registry::instance().add(std::move(call));
 }
 
+void http_server_base::update_config_handler(const http_request &req, 
http_response &resp)
+{
+    auto res = dsn::update_config(req);
+    if (res.is_ok()) {
+        CHECK_EQ(1, req.query_args.size());
+        update_config(req.query_args.begin()->first);
+    }

Review Comment:
   Yes, the http request is ok itself.
   And it's the behavior as before 
https://github.com/apache/incubator-pegasus/pull/1198/files#diff-6d8d586cfd392c8aa927b6d2de0af7e3664180413e518f3a244839b0900c67a9L31



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to