diff options
| author | ꦌꦫꦶꦏ꧀ꦦꦿꦧꦮꦑꦩꦭ꧀ <erik@darapsa.co.id> | 2021-06-13 15:41:54 +0800 |
|---|---|---|
| committer | ꦌꦫꦶꦏ꧀ꦦꦿꦧꦮꦑꦩꦭ꧀ <erik@darapsa.co.id> | 2021-06-13 15:41:54 +0800 |
| commit | 143f5b64f187497af728a6d921c599dcc99ed807 (patch) | |
| tree | ba7264b8748c53c57697f9a1c9bf34db279ed468 /request.c | |
| parent | 4cd6fdb93eca409a76b0af860d9a0599b2f95f53 (diff) | |
Fix the way libcurl has been used
Diffstat (limited to 'request.c')
| -rw-r--r-- | request.c | 15 |
1 files changed, 12 insertions, 3 deletions
@@ -5,8 +5,17 @@ emscripten_fetch_attr_t attr; #else CURL *curl; char *server_url; +size_t append(char *data, size_t size, size_t nmemb, icclient_fetch_t *fetch) +{ + size_t realsize = size * nmemb; + fetch->data = realloc(fetch->data, fetch->numBytes + realsize + 1); + memcpy(&(fetch->data[fetch->numBytes]), data, realsize); + fetch->numBytes += realsize; + fetch->data[fetch->numBytes] = '\0'; + return realsize; +} #endif -extern inline void icclient_request_init(const char *, const char *); -extern inline void request(icclient_handler, void *, struct icclient_request_data *, char *, ...); -extern inline void icclient_request_cleanup(); +extern inline void init(const char *, const char *); +extern inline void request(void (*)(icclient_fetch_t *), void *, struct body *, char *, ...); +extern inline void cleanup(); |