From 2261e83f6d961e4c9f88dc2687881d57295e5778 Mon Sep 17 00:00:00 2001 From: deva Date: Tue, 15 Dec 2009 18:28:57 +0000 Subject: New Sessions and Session classes. --- server/src/server.cc | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) (limited to 'server/src/server.cc') diff --git a/server/src/server.cc b/server/src/server.cc index c59abbf..6a2a61b 100644 --- a/server/src/server.cc +++ b/server/src/server.cc @@ -65,7 +65,7 @@ typedef long long unsigned int sessionid_t; typedef struct { - JournalWriter *journalwriter; + JournalWriter *journalwriter; } session_t; struct conn_t { @@ -355,18 +355,6 @@ static std::string handleConnection(const char *buf, size_t size, struct conn_t return res; } -static sessionid_t newSessionID(struct conn_t *conn) -{ - sessionid_t sid; - conn->mutex.lock(); - // Find a random session id that is not in use. - do { - sid = rand(); - } while(conn->sessions.find(sid) != conn->sessions.end()); - conn->mutex.unlock(); - return sid; -} - static int handle_request(void *cls, struct MHD_Connection *con, const char *url, @@ -388,7 +376,7 @@ static int handle_request(void *cls, const char *sessionids = MHD_lookup_connection_value(con, MHD_HEADER_KIND, "SessionID"); if(sessionids == NULL) { - sessionid = newSessionID(conn); + sessionid = 42;//newSessionID(conn); } else { sessionid = atoll(sessionids); conn->mutex.lock(); -- cgit v1.2.3