From cc982a578d3dc3f79bb9779616d7395d94111ecd Mon Sep 17 00:00:00 2001 From: Dennis Luxen Date: Wed, 7 May 2014 19:30:22 +0200 Subject: [PATCH] deactivate the cool put_time thing in C++11 as GCC craps out again --- Server/RequestHandler.cpp | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/Server/RequestHandler.cpp b/Server/RequestHandler.cpp index 605342c47..3b1938736 100644 --- a/Server/RequestHandler.cpp +++ b/Server/RequestHandler.cpp @@ -40,7 +40,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include -#include +// #include #include RequestHandler::RequestHandler() : routing_machine(NULL) { } @@ -51,10 +51,26 @@ void RequestHandler::handle_request(const http::Request& req, http::Reply& rep){ std::string request; URIDecode(req.uri, request); - std::time_t t = std::time(nullptr); + // deactivated as GCC apparently does not implement that, not even in 4.9 + // std::time_t t = std::time(nullptr); + // SimpleLogger().Write() << std::put_time(std::localtime(&t), "%m-%d-%Y %H:%M:%S") << + // " " << req.endpoint.to_string() << " " << + // req.referrer << ( 0 == req.referrer.length() ? "- " :" ") << + // req.agent << ( 0 == req.agent.length() ? "- " :" ") << request; - SimpleLogger().Write() << std::put_time(std::localtime(&t), "%m-%d-%Y %H:%M:%S") << - " " << req.endpoint.to_string() << " " << + time_t ltime; + struct tm *Tm; + + ltime=time(NULL); + Tm=localtime(<ime); + + SimpleLogger().Write() << + (Tm->tm_mday < 10 ? "0" : "" ) << Tm->tm_mday << "-" << + (Tm->tm_mon+1 < 10 ? "0" : "" ) << (Tm->tm_mon+1) << "-" << + 1900+Tm->tm_year << " " << (Tm->tm_hour < 10 ? "0" : "" ) << + Tm->tm_hour << ":" << (Tm->tm_min < 10 ? "0" : "" ) << + Tm->tm_min << ":" << (Tm->tm_sec < 10 ? "0" : "" ) << + Tm->tm_sec << " " << req.endpoint.to_string() << " " << req.referrer << ( 0 == req.referrer.length() ? "- " :" ") << req.agent << ( 0 == req.agent.length() ? "- " :" ") << request;