diff options
Diffstat (limited to 'rotord/rotord.cpp')
| -rw-r--r-- | rotord/rotord.cpp | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/rotord/rotord.cpp b/rotord/rotord.cpp index ccb770b..965d290 100644 --- a/rotord/rotord.cpp +++ b/rotord/rotord.cpp @@ -14,7 +14,7 @@ void RotorRequestHandler::handleRequest(HTTPServerRequest& request,HTTPServerRes std::ostream& ostr = response.send(); ostr << "<html><head><title>RotorServer powered by " "POCO C++ Libraries</title>"; - ostr << "<meta http-equiv=\"refresh\" content=\"1\"></head>"; + ostr << "</head>"; ostr << "<body><p style=\"text-align: center; " "font-size: 48px;\">"; ostr << dt; @@ -27,8 +27,23 @@ RotorRequestHandlerFactory::RotorRequestHandlerFactory(const std::string& format HTTPRequestHandler* RotorRequestHandlerFactory::createRequestHandler(const HTTPServerRequest& request){ Application& app = Application::instance(); - app.logger().information("Request from "+ request.clientAddress().toString()+": "+request.getURI()); - if (request.getURI() == "/") + + Poco::URI theuri=Poco::URI(request.getURI()); + std::vector <std::string> segments; + theuri.getPathSegments(segments); + + std::ostringstream ostr; + ostr << segments.size(); + + std::string out; + for (uint i=0;i<segments.size();i++) { + out+=segments[i]; + out+=" "; + } + + app.logger().information("Request from "+ request.clientAddress().toString()+" "+ostr.str()+" segments: "+out); + + if (segments.size() == 0) return new RotorRequestHandler(_format); else return 0; |
