diff options
Diffstat (limited to 'server/src/server.cc')
-rw-r--r-- | server/src/server.cc | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/server/src/server.cc b/server/src/server.cc index e4d6474..838da32 100644 --- a/server/src/server.cc +++ b/server/src/server.cc @@ -37,6 +37,9 @@ #include "client_connection.h" #include "admin_connection.h" +extern std::string logfile; +extern volatile bool logfile_reload; + class PracroHttpd : public Httpd { public: PracroHttpd() {} @@ -57,6 +60,12 @@ public: headers_t &getargs, headers_t &headers) { + if(logfile_reload) { + DEBUG(pracrod, "Reopen log file %s\n", logfile.c_str()); + debug_reinit(logfile.c_str()); + logfile_reload = false; + } + Connection *connection = NULL; if(headers.find("User-Agent") != headers.end() && @@ -73,7 +82,7 @@ public: { if(ptr) { Connection *connection = (Connection *)ptr; - connection->handle(data, data_size); + connection->data(data, data_size); } return true; } @@ -84,7 +93,7 @@ public: Connection *connection = (Connection *)ptr; // Flush and do commit/discards - connection->handle(NULL, 0); + if(!connection->handle()) return false; connection->getReply(reply); } |