diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/afb-context.c | 7 | ||||
-rw-r--r-- | src/afb-context.h | 1 | ||||
-rw-r--r-- | src/afb-hook.c | 2 | ||||
-rw-r--r-- | src/afb-monitor.c | 3 | ||||
-rw-r--r-- | src/afb-msg-json.c | 6 | ||||
-rw-r--r-- | src/afb-session.c | 8 | ||||
-rw-r--r-- | src/afb-session.h | 1 | ||||
-rw-r--r-- | src/afb-supervision.c | 4 | ||||
-rw-r--r-- | src/afb-trace.c | 2 | ||||
-rw-r--r-- | src/afb-ws-json1.c | 2 | ||||
-rw-r--r-- | src/tests/session/test-session.c | 3 |
11 files changed, 7 insertions, 32 deletions
diff --git a/src/afb-context.c b/src/afb-context.c index 33cca0e9..4cdaa6f7 100644 --- a/src/afb-context.c +++ b/src/afb-context.c @@ -102,13 +102,6 @@ void afb_context_disconnect(struct afb_context *context) } } -const char *afb_context_sent_token(struct afb_context *context) -{ - if (context->session == NULL || context->closing || context->super) - return NULL; - return afb_session_token(context->session); -} - const char *afb_context_uuid(struct afb_context *context) { return context->session ? afb_session_uuid(context->session) : ""; diff --git a/src/afb-context.h b/src/afb-context.h index 2d44611b..83d01218 100644 --- a/src/afb-context.h +++ b/src/afb-context.h @@ -44,7 +44,6 @@ extern void afb_context_subinit(struct afb_context *context, struct afb_context extern int afb_context_connect(struct afb_context *context, const char *uuid, const char *token); extern int afb_context_connect_validated(struct afb_context *context, const char *uuid); extern void afb_context_disconnect(struct afb_context *context); -extern const char *afb_context_sent_token(struct afb_context *context); extern const char *afb_context_sent_uuid(struct afb_context *context); extern const char *afb_context_uuid(struct afb_context *context); diff --git a/src/afb-hook.c b/src/afb-hook.c index 6b1ab10c..1379caf8 100644 --- a/src/afb-hook.c +++ b/src/afb-hook.c @@ -1531,7 +1531,7 @@ static void _hook_session_(struct afb_session *session, const char *format, ...) static void hook_session_create_cb(void *closure, const struct afb_hookid *hookid, struct afb_session *session) { - _hook_session_(session, "create -> token=%s", afb_session_token(session)); + _hook_session_(session, "create"); } static void hook_session_close_cb(void *closure, const struct afb_hookid *hookid, struct afb_session *session) diff --git a/src/afb-monitor.c b/src/afb-monitor.c index 13687d36..e32c85ac 100644 --- a/src/afb-monitor.c +++ b/src/afb-monitor.c @@ -381,9 +381,8 @@ static void f_session(afb_req_t req) } /* make the result */ - wrap_json_pack(&r, "{s:s,s:s,s:i,s:i}", + wrap_json_pack(&r, "{s:s,s:i,s:i}", "uuid", afb_session_uuid(xreq->context.session), - "token", afb_session_token(xreq->context.session), "timeout", afb_session_timeout(xreq->context.session), "remain", afb_session_what_remains(xreq->context.session)); afb_req_success(req, r, NULL); diff --git a/src/afb-msg-json.c b/src/afb-msg-json.c index b1a83e73..fc736321 100644 --- a/src/afb-msg-json.c +++ b/src/afb-msg-json.c @@ -27,7 +27,7 @@ static const char _success_[] = "success"; struct json_object *afb_msg_json_reply(struct json_object *resp, const char *error, const char *info, struct afb_context *context) { json_object *msg, *request; - const char *token, *uuid; + const char *uuid; json_object *type_reply = NULL; msg = json_object_new_object(); @@ -45,10 +45,6 @@ struct json_object *afb_msg_json_reply(struct json_object *resp, const char *err json_object_object_add(request, "info", json_object_new_string(info)); if (context != NULL) { - token = afb_context_sent_token(context); - if (token != NULL) - json_object_object_add(request, "token", json_object_new_string(token)); - uuid = afb_context_sent_uuid(context); if (uuid != NULL) json_object_object_add(request, "uuid", json_object_new_string(uuid)); diff --git a/src/afb-session.c b/src/afb-session.c index 8fa44341..bb10c2cb 100644 --- a/src/afb-session.c +++ b/src/afb-session.c @@ -540,7 +540,7 @@ int afb_session_check_token (struct afb_session *session, const char *token) session_lock(session); r = !session->closed && session->expiration >= NOW - && !(session->token && strcmp(token, afb_session_token(session))); + && !(session->token && strcmp(token, afb_token_string(session->token))); session_unlock(session); return r; } @@ -551,12 +551,6 @@ const char *afb_session_uuid (struct afb_session *session) return session->uuid; } -/* Returns the token of 'session' */ -const char *afb_session_token (struct afb_session *session) -{ - return afb_token_string(session->token); -} - /** * Get the index of the 'key' in the cookies array. * @param key the key to scan diff --git a/src/afb-session.h b/src/afb-session.h index f6e848c8..6d17f87f 100644 --- a/src/afb-session.h +++ b/src/afb-session.h @@ -41,7 +41,6 @@ extern void afb_session_close(struct afb_session *session); extern int afb_session_is_closed (struct afb_session *session); extern int afb_session_check_token(struct afb_session *session, const char *token); -extern const char *afb_session_token(struct afb_session *session); extern int afb_session_timeout(struct afb_session *session); extern int afb_session_what_remains(struct afb_session *session); diff --git a/src/afb-supervision.c b/src/afb-supervision.c index 1575ae29..df045806 100644 --- a/src/afb-supervision.c +++ b/src/afb-supervision.c @@ -292,10 +292,8 @@ int afb_supervision_init(struct afb_apiset *apiset, struct json_object *config) static void slist(void *closure, struct afb_session *session) { struct json_object *list = closure; - struct json_object *item; - wrap_json_pack(&item, "{ss}", "token", afb_session_token(session)); - json_object_object_add(list, afb_session_uuid(session), item); + json_object_object_add(list, afb_session_uuid(session), NULL); } /****************************************************************************** diff --git a/src/afb-trace.c b/src/afb-trace.c index 5e349c7e..5f8ec64c 100644 --- a/src/afb-trace.c +++ b/src/afb-trace.c @@ -853,7 +853,7 @@ static void hook_session(void *closure, const struct afb_hookid *hookid, struct static void hook_session_create(void *closure, const struct afb_hookid *hookid, struct afb_session *session) { - hook_session(closure, hookid, session, "create", "{ss}", "token", afb_session_token(session)); + hook_session(closure, hookid, session, "create", NULL); } static void hook_session_close(void *closure, const struct afb_hookid *hookid, struct afb_session *session) diff --git a/src/afb-ws-json1.c b/src/afb-ws-json1.c index d0cca2bd..743f5a52 100644 --- a/src/afb-ws-json1.c +++ b/src/afb-ws-json1.c @@ -260,7 +260,7 @@ static void wsreq_reply(struct afb_xreq *xreq, struct json_object *object, const reply = afb_msg_json_reply(object, error, info, &xreq->context); rc = (error ? afb_wsj1_reply_error_j : afb_wsj1_reply_ok_j)( - wsreq->msgj1, reply, afb_context_sent_token(&wsreq->xreq.context)); + wsreq->msgj1, reply, NULL); if (rc) ERROR("Can't send reply: %m"); } diff --git a/src/tests/session/test-session.c b/src/tests/session/test-session.c index 444475ef..acdfcef4 100644 --- a/src/tests/session/test-session.c +++ b/src/tests/session/test-session.c @@ -53,13 +53,10 @@ START_TEST (check_creation) /* the session is valid */ ck_assert(afb_session_uuid(s) != NULL); - ck_assert(afb_session_token(s) != NULL); ck_assert(!afb_session_is_closed(s)); /* token is the initial one */ - ck_assert_str_eq(afb_session_token(s), GOOD_UUID); ck_assert(afb_session_check_token(s, GOOD_UUID)); - ck_assert(afb_session_check_token(s, afb_session_token(s))); /* query the session */ uuid = strdup(afb_session_uuid(s)); |