Commit 39cd5b83 authored by Sergey Lyubka's avatar Sergey Lyubka

Signature for mg_get_cookie changed

parent ca96db71
...@@ -56,9 +56,10 @@ static pthread_rwlock_t rwlock = PTHREAD_RWLOCK_INITIALIZER; ...@@ -56,9 +56,10 @@ static pthread_rwlock_t rwlock = PTHREAD_RWLOCK_INITIALIZER;
// Get session object for the connection. Caller must hold the lock. // Get session object for the connection. Caller must hold the lock.
static struct session *get_session(const struct mg_connection *conn) { static struct session *get_session(const struct mg_connection *conn) {
int i; int i;
const char *cookie = mg_get_header(conn, "Cookie");
char session_id[33]; char session_id[33];
time_t now = time(NULL); time_t now = time(NULL);
mg_get_cookie(conn, "session", session_id, sizeof(session_id)); mg_get_cookie(cookie, "session", session_id, sizeof(session_id));
for (i = 0; i < MAX_SESSIONS; i++) { for (i = 0; i < MAX_SESSIONS; i++) {
if (sessions[i].expire != 0 && if (sessions[i].expire != 0 &&
sessions[i].expire > now && sessions[i].expire > now &&
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment