From daf858c02db1a5a12151d142ce55dfe9fbb2b715 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=A6=8C=EA=A6=AB=EA=A6=B6=EA=A6=8F=EA=A7=80=EA=A6=A6?= =?UTF-8?q?=EA=A6=BF=EA=A6=A7=EA=A6=AE=EA=A6=91=EA=A6=A9=EA=A6=AD=EA=A7=80?= Date: Sun, 13 Jun 2021 08:40:26 +0800 Subject: Merge catalog and product to client --- request.h | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'request.h') diff --git a/request.h b/request.h index a43a44a..19ed118 100644 --- a/request.h +++ b/request.h @@ -4,11 +4,10 @@ #if defined __ANDROID__ && defined DEBUG #include #endif -#include -#include #include #include -#include +#include +#include #ifndef __EMSCRIPTEN__ #include #endif @@ -29,12 +28,11 @@ extern CURL *curl; extern char *server_url; #endif -inline bool icclient_request_init(const char *url, const char *certificate) +inline void icclient_request_init(const char *url, const char *certificate) { #ifdef __EMSCRIPTEN__ emscripten_fetch_attr_init(&attr); attr.attributes = EMSCRIPTEN_FETCH_LOAD_TO_MEMORY; - return true; #else curl_global_init(CURL_GLOBAL_SSL); curl = curl_easy_init(); @@ -47,13 +45,12 @@ inline bool icclient_request_init(const char *url, const char *certificate) curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L); #endif size_t length = strlen(url); - bool append = !(bool)(url[length - 1] == '/'); - server_url = malloc(length + (size_t)append + 1); + size_t append = !(url[length - 1] == '/'); + server_url = malloc(length + append + 1); strcpy(server_url, url); if (append) strcat(server_url, "/"); } - return (bool)curl; #endif } -- cgit v1.2.3