diff options
author | Stefan Radomski <radomski@tk.informatik.tu-darmstadt.de> | 2013-02-20 21:55:27 (GMT) |
---|---|---|
committer | Stefan Radomski <radomski@tk.informatik.tu-darmstadt.de> | 2013-02-20 21:55:27 (GMT) |
commit | 47956a35d11495f2ebf6988c7f9d9dffe0bd3a4b (patch) | |
tree | b991daf52ca2051d2e3f89f8143b843bf1318449 /src/uscxml/server/HTTPServer.h | |
parent | 8c30e4f664bb8b68f965165035ec29115486b065 (diff) | |
download | uscxml-47956a35d11495f2ebf6988c7f9d9dffe0bd3a4b.zip uscxml-47956a35d11495f2ebf6988c7f9d9dffe0bd3a4b.tar.gz uscxml-47956a35d11495f2ebf6988c7f9d9dffe0bd3a4b.tar.bz2 |
Beautified source code again
Diffstat (limited to 'src/uscxml/server/HTTPServer.h')
-rw-r--r-- | src/uscxml/server/HTTPServer.h | 68 |
1 files changed, 34 insertions, 34 deletions
diff --git a/src/uscxml/server/HTTPServer.h b/src/uscxml/server/HTTPServer.h index 597c749..a387e1f 100644 --- a/src/uscxml/server/HTTPServer.h +++ b/src/uscxml/server/HTTPServer.h @@ -11,42 +11,42 @@ namespace uscxml { class HTTPServlet; - + class HTTPServer { public: - class Request { - public: - Request() : curlReq(NULL) {} - std::string type; - std::map<std::string, std::string> headers; - std::string content; - std::string remoteHost; - unsigned short remotePort; - std::string httpMajor; - std::string httpMinor; - std::string uri; - struct evhttp_request* curlReq; - }; - - class Reply { - public: - Reply(Request req) : status(200), type(req.type), curlReq(req.curlReq) {} - int status; - std::string type; - std::map<std::string, std::string> headers; - std::string content; - struct evhttp_request* curlReq; - }; - - struct CallbackData { + class Request { + public: + Request() : curlReq(NULL) {} + std::string type; + std::map<std::string, std::string> headers; + std::string content; + std::string remoteHost; + unsigned short remotePort; + std::string httpMajor; + std::string httpMinor; + std::string uri; + struct evhttp_request* curlReq; + }; + + class Reply { + public: + Reply(Request req) : status(200), type(req.type), curlReq(req.curlReq) {} + int status; + std::string type; + std::map<std::string, std::string> headers; + std::string content; + struct evhttp_request* curlReq; + }; + + struct CallbackData { HTTPServlet* servlet; evhttp_request* httpReq; }; - static HTTPServer* getInstance(int port = 8080); - static void reply(const Reply& reply); - - static bool registerServlet(const std::string& path, HTTPServlet* servlet); ///< Register a servlet, returns false if path is already taken + static HTTPServer* getInstance(int port = 8080); + static void reply(const Reply& reply); + + static bool registerServlet(const std::string& path, HTTPServlet* servlet); ///< Register a servlet, returns false if path is already taken static void unregisterServlet(HTTPServlet* servlet); private: @@ -58,7 +58,7 @@ private: static void run(void* instance); void determineAddress(); - + static void httpRecvReqCallback(struct evhttp_request *req, void *callbackData); std::map<std::string, HTTPServlet*> _servlets; @@ -72,7 +72,7 @@ private: std::string _address; static HTTPServer* _instance; - + static tthread::recursive_mutex _instanceMutex; tthread::thread* _thread; tthread::recursive_mutex _mutex; @@ -83,8 +83,8 @@ private: class HTTPServlet { public: - virtual void httpRecvRequest(const HTTPServer::Request& request) = 0; - virtual void setURL(const std::string& url) = 0; /// Called by the server with the actual URL + virtual void httpRecvRequest(const HTTPServer::Request& request) = 0; + virtual void setURL(const std::string& url) = 0; /// Called by the server with the actual URL }; } |