summaryrefslogtreecommitdiffstats
path: root/agl-identity-service
diff options
context:
space:
mode:
authorLoïc Collignon <loic.collignon@iot.bzh>2017-11-08 15:21:40 +0100
committerJosé Bollo <jose.bollo@iot.bzh>2017-11-08 21:55:34 +0100
commit16b850197b684327bc4fc67badea261ebc1de902 (patch)
tree83196d4bd6b31fd04c8fc1e1689178376080bdc9 /agl-identity-service
parent2ca7f3a4a03db3e7d7fa15504fa3d69e1c6bd217 (diff)
Rename 'upload' to 'download' functions
Change-Id: Idb0c1b549aa2a6bf0f1740578019b6c37b89a7dc Signed-off-by: Loïc Collignon <loic.collignon@iot.bzh>
Diffstat (limited to 'agl-identity-service')
-rw-r--r--agl-identity-service/src/agl-identity-binding.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/agl-identity-service/src/agl-identity-binding.c b/agl-identity-service/src/agl-identity-binding.c
index 1feeeb3..7920fd8 100644
--- a/agl-identity-service/src/agl-identity-binding.c
+++ b/agl-identity-service/src/agl-identity-binding.c
@@ -176,7 +176,7 @@ static void do_logout()
/****************************************************************/
-static char *get_upload_url(const char *key)
+static char *get_download_url(const char *key)
{
int rc;
char *result;
@@ -185,7 +185,7 @@ static char *get_upload_url(const char *key)
return rc >= 0 ? result : NULL;
}
-static void uploaded(void *closure, int status, const void *buffer, size_t size)
+static void downloaded(void *closure, int status, const void *buffer, size_t size)
{
struct json_object *object, *subobj;
char *url = closure;
@@ -227,17 +227,19 @@ static void uploaded(void *closure, int status, const void *buffer, size_t size)
goto end;
}
+ // TODO: save the object into the database
+
do_login(subobj);
json_object_put(object);
end:
free(url);
}
-static void upload_request(const char *address)
+static void download_request(const char *address)
{
- char *url = get_upload_url(address);
+ char *url = get_download_url(address);
if (url)
- aia_get(url, expiration_delay, oidc_name, oidc_name, uploaded, url);
+ aia_get(url, expiration_delay, oidc_name, oidc_name, downloaded, url);
else
AFB_ERROR("out of memory");
}