abouttreesummaryrefslogcommitdiff
path: root/examples/Login.c
diff options
context:
space:
mode:
authorPatrick2023-05-28 15:07:34 +0200
committerPatrick2023-05-28 15:07:34 +0200
commit5cb22046a33f24c1a696990f95e13d534efef497 (patch)
treea2c3c1baa74b61c72c8bb3514ff694e2f65bc105 /examples/Login.c
parent27a83e93114c31de4b7bd33320a85e5fad0196a3 (diff)
downloadmatrix_esp_thesis-5cb22046a33f24c1a696990f95e13d534efef497.tar.gz
matrix_esp_thesis-5cb22046a33f24c1a696990f95e13d534efef497.zip
mongoose as http client
Diffstat (limited to 'examples/Login.c')
-rw-r--r--examples/Login.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/examples/Login.c b/examples/Login.c
index 69ac3a1..1c8e7cd 100644
--- a/examples/Login.c
+++ b/examples/Login.c
@@ -1,6 +1,6 @@
#include <stdio.h>
#include <matrix.h>
-#include <curl/curl.h>
+#include <mongoose.h>
#define SERVER "https://matrix.org"
#define USERNAME "pscho"
@@ -14,8 +14,7 @@ main()
MatrixClient client;
MatrixClientInit(&client, SERVER, strlen(SERVER));
- curl_global_init(CURL_GLOBAL_DEFAULT);
- client.httpUserData = (void *)curl_easy_init();
+ MatrixHttpInit(&client);
MatrixClientLoginPassword(&client,
USERNAME, strlen(USERNAME),
@@ -27,8 +26,7 @@ main()
printf("Expires in (ms): %.*s\n", client.expireMsLen, client.expireMsBuffer);
printf("Refresh Token: %.*s\n", client.refreshTokenLen, client.refreshTokenBuffer);
- curl_easy_cleanup((CURL *)client.httpUserData);
- curl_global_cleanup();
+ MatrixHttpDeinit(&client);
return 0;
} \ No newline at end of file