Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
M
mongoose
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
esp
mongoose
Commits
39cd5b83
Commit
39cd5b83
authored
May 10, 2013
by
Sergey Lyubka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Signature for mg_get_cookie changed
parent
ca96db71
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
1 deletion
+2
-1
chat.c
examples/chat.c
+2
-1
No files found.
examples/chat.c
View file @
39cd5b83
...
@@ -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
(
co
nn
,
"session"
,
session_id
,
sizeof
(
session_id
));
mg_get_cookie
(
co
okie
,
"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
&&
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment