diff options
Diffstat (limited to 'server/src/server.cc')
-rw-r--r-- | server/src/server.cc | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/server/src/server.cc b/server/src/server.cc index 118db85..1f85479 100644 --- a/server/src/server.cc +++ b/server/src/server.cc @@ -69,8 +69,12 @@ static int handle_request_callback(void *cls, const char *scm = MHD_lookup_connection_value(con, MHD_HEADER_KIND, "SessionCommit"); + + const char *sdc = MHD_lookup_connection_value(con, MHD_HEADER_KIND, + "SessionDiscard"); + Environment *env = (Environment *)cls; - connection = new Connection(*env, sessionid, scm != NULL); + connection = new Connection(*env, sessionid, scm != NULL, sdc != NULL); *con_cls = connection; } @@ -130,7 +134,7 @@ void server() { srand(time(NULL)); - bool forceshutdown = false; + // bool forceshutdown = false; port_t port = Conf::server_port; int flags = MHD_USE_DEBUG | MHD_USE_SELECT_INTERNALLY; @@ -161,9 +165,9 @@ void server() PRACRO_ERR(server, "Failed to initialise MHD_start_daemon!\n"); return; } - again: + // again: while(pracro_is_running) sleep(1); - + /* if(!forceshutdown && env.sessions.size() != 0) { char *errbuf; if(asprintf(&errbuf, "There are %d live sessions." @@ -177,6 +181,8 @@ void server() forceshutdown = true; goto again; } + */ + env.sessions.store(); MHD_stop_daemon(d); |