Browse Source

Test

etomic
jl777 7 years ago
parent
commit
75ae3df677
  1. 6
      crypto777/bitcoind_RPC.c
  2. 6
      crypto777/cJSON.c
  3. 2
      iguana/exchanges/LP_nativeDEX.c

6
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

6
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)
{

2
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)

Loading…
Cancel
Save