]> git.ipfire.org Git - thirdparty/pdns.git/blobdiff - pdns/webserver.hh
Webserver: convert to new yahttp api and router
[thirdparty/pdns.git] / pdns / webserver.hh
index e9fabd282563c8e18d90004c839d10a52d46504c..5b3376748d986d6480a930f54e650279eb8319b4 100644 (file)
@@ -36,7 +36,6 @@ class HttpRequest : public YaHTTP::Request {
 public:
   HttpRequest() : YaHTTP::Request(), accept_json(false), accept_html(false), complete(false) { };
 
-  map<string,string> path_parameters;
   bool accept_json;
   bool accept_html;
   bool complete;
@@ -46,7 +45,6 @@ public:
 class HttpResponse: public YaHTTP::Response {
 public:
   HttpResponse() : YaHTTP::Response() { };
-  HttpResponse(const YaHTTP::Request &req) : YaHTTP::Response(req) { };
   HttpResponse(const YaHTTP::Response &resp) : YaHTTP::Response(resp) { };
 
   void setBody(rapidjson::Document& document);
@@ -135,19 +133,12 @@ public:
   HttpResponse handleRequest(HttpRequest request);
 
   typedef boost::function<void(HttpRequest* req, HttpResponse* resp)> HandlerFunction;
-  struct HandlerRegistration {
-    std::list<string> urlParts;
-    std::list<string> paramNames;
-    HandlerFunction handler;
-  };
-
   void registerHandler(const string& url, HandlerFunction handler);
   void registerApiHandler(const string& url, HandlerFunction handler);
 
 protected:
   static char B64Decode1(char cInChar);
   static int B64Decode(const std::string& strInput, std::string& strOutput);
-  bool route(const std::string& url, std::map<std::string, std::string>& urlArgs, HandlerFunction** handler);
 
   virtual Server* createServer() {
     return new Server(d_listenaddress, d_port);
@@ -155,7 +146,6 @@ protected:
 
   string d_listenaddress;
   int d_port;
-  std::list<HandlerRegistration> d_handlers;
   string d_password;
   Server* d_server;
 };