From 75ae3df6778c3b7063bdc184eebd0be3f62ffa8b Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 15 Nov 2017 23:56:15 +0200 Subject: [PATCH] Test --- crypto777/bitcoind_RPC.c | 6 ++++-- crypto777/cJSON.c | 6 ++++-- iguana/exchanges/LP_nativeDEX.c | 2 +- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/crypto777/bitcoind_RPC.c b/crypto777/bitcoind_RPC.c index a3488aeae..1116526fc 100755 --- a/crypto777/bitcoind_RPC.c +++ b/crypto777/bitcoind_RPC.c @@ -47,6 +47,7 @@ struct return_string { size_t accumulate(void *ptr, size_t size, size_t nmemb, struct return_string *s); void init_string(struct return_string *s); +static size_t WriteMemoryCallback(void *ptr,size_t size,size_t nmemb,void *data); /************************************************************************ @@ -161,13 +162,14 @@ try_again: *retstrp = 0; starttime = OS_milliseconds(); curl_handle = curl_easy_init(); - init_string(&s); + //init_string(&s); headers = curl_slist_append(0,"Expect:"); curl_easy_setopt(curl_handle,CURLOPT_USERAGENT,"mozilla/4.0");//"Mozilla/4.0 (compatible; )"); curl_easy_setopt(curl_handle,CURLOPT_HTTPHEADER, headers); curl_easy_setopt(curl_handle,CURLOPT_URL, url); - curl_easy_setopt(curl_handle,CURLOPT_WRITEFUNCTION, (void *)accumulate); // send all data to this function + //curl_easy_setopt(curl_handle,CURLOPT_WRITEFUNCTION, (void *)accumulate); // send all data to this function + curl_easy_setopt(curl_handle,CURLOPT_WRITEFUNCTION, (void *)WriteMemoryCallback); curl_easy_setopt(curl_handle,CURLOPT_WRITEDATA, &s); // we pass our 's' struct to the callback curl_easy_setopt(curl_handle,CURLOPT_NOSIGNAL, 1L); // supposed to fix "Alarm clock" and long jump crash curl_easy_setopt(curl_handle,CURLOPT_NOPROGRESS, 1L); // no progress callback diff --git a/crypto777/cJSON.c b/crypto777/cJSON.c index 93438fe79..4c0777656 100755 --- a/crypto777/cJSON.c +++ b/crypto777/cJSON.c @@ -54,8 +54,10 @@ static int32_t cJSON_strcasecmp(const char *s1,const char *s2) return tolower((int32_t)(*(const unsigned char *)s1)) - tolower((int32_t)(*(const unsigned char *)s2)); } -static void *(*cJSON_malloc)(size_t sz) = malloc; -static void (*cJSON_free)(void *ptr) = free; +void *LP_alloc(uint64_t len); +void LP_free(void *ptr); +static void *(*cJSON_malloc)(size_t sz) = (void *)LP_alloc; +static void (*cJSON_free)(void *ptr) = LP_free; static char* cJSON_strdup(const char* str) { diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index 9980c7d3e..141cfca81 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -1226,7 +1226,7 @@ void LP_free(void *ptr) { static uint32_t lasttime,unknown; uint32_t now; int32_t n; uint64_t total = 0; struct LP_memory_list *mp,*tmp; - if ( (now= (uint32_t)time(NULL)) > lasttime+600 ) + if ( (now= (uint32_t)time(NULL)) > lasttime+6 ) { n = 0; DL_FOREACH_SAFE(LP_memory_list,mp,tmp)