diff options
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(); |