diff options
author | deva <deva> | 2009-12-15 18:28:57 +0000 |
---|---|---|
committer | deva <deva> | 2009-12-15 18:28:57 +0000 |
commit | 2261e83f6d961e4c9f88dc2687881d57295e5778 (patch) | |
tree | 684049ff65a51a57a2e115df5b4ba1d6d0c3cd7e /server/src/server.cc | |
parent | 708f52b2905701457188732d4b6881d5284674b4 (diff) |
New Sessions and Session classes.
Diffstat (limited to 'server/src/server.cc')
-rw-r--r-- | server/src/server.cc | 16 |
1 files changed, 2 insertions, 14 deletions
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(); |