summaryrefslogtreecommitdiffstats
path: root/src/afb-session.c
diff options
context:
space:
mode:
authorJosé Bollo <jose.bollo@iot.bzh>2018-09-14 10:14:31 +0200
committerJosé Bollo <jose.bollo@iot.bzh>2018-09-14 10:21:09 +0200
commitc19ce12fca7560d3712d4e1661e06be3592baf75 (patch)
tree99581a639a45f839278cf9f488eaf2c09a1a34f0 /src/afb-session.c
parent80c96d74b4ffe8df5d0567da52776a409b2483bf (diff)
afb-session: Fix an issue in managing sessions
Probably an old copy/paste error in the commit d45426257d5149c735e33e3055220625a919e7bc It doesn't affect version EE (Electric Eel). Bug-AGL: SPEC-1735 Change-Id: Ia1536e141ac12275000196a3218eb62d77b36a06 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
Diffstat (limited to 'src/afb-session.c')
-rw-r--r--src/afb-session.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/afb-session.c b/src/afb-session.c
index fdc88fdf..00aac69d 100644
--- a/src/afb-session.c
+++ b/src/afb-session.c
@@ -574,7 +574,7 @@ int afb_session_check_token (struct afb_session *session, const char *token)
{
int r;
- session_unlock(session);
+ session_lock(session);
r = !session->closed
&& session->expiration >= NOW
&& !(session->token[0] && strcmp (token, session->token));
@@ -585,7 +585,7 @@ int afb_session_check_token (struct afb_session *session, const char *token)
/* generate a new token and update client context */
void afb_session_new_token (struct afb_session *session)
{
- session_unlock(session);
+ session_lock(session);
new_uuid(session->token);
session_update_expiration(session, NOW);
afb_hook_session_renew(session);