summaryrefslogtreecommitdiff
path: root/server/src
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2012-03-01 12:23:35 +0100
committerBent Bisballe Nyeng <deva@aasimon.org>2012-03-01 12:23:35 +0100
commit2f90b203abb638b8c18db166102a0ef183c9b213 (patch)
tree1574e17402d770c7d5b01837f6ece3846ef1c3af /server/src
parentd0094998c68419101d518e31135694bbba6a9a22 (diff)
Only print *data_size bytes from data to debug output. Added connection time to debug output.
Diffstat (limited to 'server/src')
-rw-r--r--server/src/httpd.cc7
1 files changed, 6 insertions, 1 deletions
diff --git a/server/src/httpd.cc b/server/src/httpd.cc
index 1c0575a..62e4c9f 100644
--- a/server/src/httpd.cc
+++ b/server/src/httpd.cc
@@ -38,6 +38,7 @@
#include <string.h>
#include <microhttpd.h>
+#include <time.h>
#include "debug.h"
@@ -68,10 +69,14 @@ static int request_handler(void *cls,
unsigned int *data_size,
void **con_cls)
{
+ time_t now = time(NULL);
+ DEBUG(httpd, "Request time: %s", ctime(&now));
DEBUG(httpd, "request_handler: cls(%p) con(%p) url(%s) method(%s)"
" version(%s) *con_cls(%p)\n",
cls, con, url, method, version, *con_cls);
- DEBUG(httpd, "request_handler: *data_size(%u) data:[%s]\n", *data_size, data);
+ std::string datastr; datastr.append(data, *data_size);
+ DEBUG(httpd, "request_handler: *data_size(%u) data:[%s]\n",
+ *data_size, datastr.c_str());
int ret = MHD_YES;