]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/seastar/src/http/json_path.cc
update source to Ceph Pacific 16.2.2
[ceph.git] / ceph / src / seastar / src / http / json_path.cc
index 125b0d9a9b48cbe14c92a3f8da13d6a217cd7e38..b9e5b8ca385f6e4ab6b7503d57d593f1064e94c5 100644 (file)
@@ -44,7 +44,7 @@ void path_description::set(routes& _routes, handler_base* handler) const {
                 rule->add_param(i.name, i.type == url_component_type::PARAM_UNTIL_END_OF_PATH);
             }
         }
-        _routes.add(rule, operations.method);
+        _cookie = _routes.add_cookie(rule, operations.method);
     }
 }
 
@@ -57,6 +57,15 @@ void path_description::set(routes& _routes, const future_json_function& f) const
     set(_routes, new function_handler(f));
 }
 
+void path_description::unset(routes& _routes) const {
+    if (params.size() == 0) {
+        _routes.drop(operations.method, path);
+    } else {
+        auto rule = _routes.del_cookie(_cookie, operations.method);
+        delete rule;
+    }
+}
+
 path_description::path_description(const sstring& path, operation_type method,
         const sstring& nickname,
         const std::vector<std::pair<sstring, bool>>& path_parameters,