#include "session.h"
#include "afb-context.h"
-
-void afb_context_init(struct afb_context *context, struct AFB_clientCtx *session, const char *token)
+static void init_context(struct afb_context *context, struct AFB_clientCtx *session, const char *token)
{
assert(session != NULL);
}
}
+void afb_context_init(struct afb_context *context, struct AFB_clientCtx *session, const char *token)
+{
+ init_context(context, ctxClientAddRef(session), token);
+}
+
int afb_context_connect(struct afb_context *context, const char *uuid, const char *token)
{
int created;
session = ctxClientGetSession (uuid, &created);
if (session == NULL)
return -1;
- afb_context_init(context, session, token);
+ init_context(context, session, token);
if (created)
context->created = 1;
return 0;