summaryrefslogtreecommitdiff
path: root/server/src/server.cc
diff options
context:
space:
mode:
authordeva <deva>2009-11-04 14:44:05 +0000
committerdeva <deva>2009-11-04 14:44:05 +0000
commit0066dc88e7a00917230aaa636d2df6535fe15276 (patch)
treed65c9cc7d57cefee1bc7fa4463731637e66bf603 /server/src/server.cc
parent2cd1f061475f496f20c9f9e297eef210524b55cd (diff)
Fixed error in connection callback function.
Diffstat (limited to 'server/src/server.cc')
-rw-r--r--server/src/server.cc18
1 files changed, 13 insertions, 5 deletions
diff --git a/server/src/server.cc b/server/src/server.cc
index a94cca3..d9b28a9 100644
--- a/server/src/server.cc
+++ b/server/src/server.cc
@@ -341,8 +341,10 @@ static int handle_request(void *cls,
unsigned int *data_size,
void **ptr)
{
- PRACRO_DEBUG(httpd, "handle_request(url=\"%s\", method=\"%s\", version=\"%s\", data_size=\"%d\")\n",
- url, method, version, *data_size);
+ PRACRO_DEBUG(httpd,
+ "handle_request(url=\"%s\", method=\"%s\","
+ " version=\"%s\", data_size=\"%d\")\n",
+ url, method, version, *data_size);
std::string reply = handleConnection((char*)data, *data_size);
@@ -351,7 +353,9 @@ static int handle_request(void *cls,
MHD_add_response_header(rsp, MHD_HTTP_HEADER_CONTENT_TYPE, "text/plain; charset=UTF-8");
int ret = MHD_queue_response(con, MHD_HTTP_OK, rsp);
MHD_destroy_response(rsp);
-
+
+ *data_size = 0;
+
return ret;
}
@@ -401,7 +405,11 @@ void server()
PRACRO_DEBUG(server, "Server running on port %d.\n", port);
struct MHD_Daemon *d;
- d = MHD_start_daemon(MHD_USE_DEBUG | MHD_USE_SELECT_INTERNALLY, // | MHD_USE_SSL,
+ d = MHD_start_daemon(MHD_USE_DEBUG
+ | MHD_USE_SELECT_INTERNALLY
+ // | MHD_USE_PEDANTIC_CHECKS
+ // | MHD_USE_SSL
+ ,
port,
NULL, NULL,
handle_request, NULL,
@@ -409,7 +417,7 @@ void server()
// MHD_OPTION_CONNECTION_LIMIT, 42,
MHD_OPTION_HTTPS_MEM_KEY, KEY,
MHD_OPTION_HTTPS_MEM_CERT, CERT,
- MHD_OPTION_CONNECTION_TIMEOUT, 0,
+ //MHD_OPTION_CONNECTION_TIMEOUT, 0,
MHD_OPTION_EXTERNAL_LOGGER, httpderr, NULL,
MHD_OPTION_END);