Update date of copyright notices
[src/app-framework-binder.git] / src / afb-context.c
index 759ee90..13733ce 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2015, 2016, 2017 "IoT.bzh"
+ * Copyright (C) 2015-2018 "IoT.bzh"
  * Author "Fulup Ar Foll"
  * Author José Bollo <jose.bollo@iot.bzh>
  *
@@ -63,7 +63,7 @@ int afb_context_connect(struct afb_context *context, const char *uuid, const cha
        int created;
        struct afb_session *session;
 
-       session = afb_session_get (uuid, &created);
+       session = afb_session_get (uuid, AFB_SESSION_TIMEOUT_DEFAULT, &created);
        if (session == NULL)
                return -1;
        init_context(context, session, token);
@@ -148,6 +148,10 @@ void afb_context_refresh(struct afb_context *context)
        else {
                assert(context->validated);
                context->refreshing = 1;
+               if (!context->refreshed) {
+                       afb_session_new_token (context->session);
+                       context->refreshed = 1;
+               }
        }
 }