diff options
author | deva <deva> | 2010-05-27 09:45:12 +0000 |
---|---|---|
committer | deva <deva> | 2010-05-27 09:45:12 +0000 |
commit | f92dd279a1e26dad7507d5d6944567c23834d440 (patch) | |
tree | 59dbd43d60937c6b3eaa82a36de8859a209e8163 /server/src/server.cc | |
parent | 73934812611cc7120175e26761d71fae9233c1e8 (diff) |
A lot of session handling. A lot of new unit tests. Add of a more structured commit/discard handling. Fix of some wierd line break bugs in journalwriter
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); |