Browse Source

Dynamic curling

pass-iguana-arg
jl777 7 years ago
parent
commit
4363bbd321
  1. 8
      crypto777/bitcoind_RPC.c

8
crypto777/bitcoind_RPC.c

@ -143,7 +143,7 @@ char *Jay_NXTrequest(char *command,char *params)
char *bitcoind_RPC(char **retstrp,char *debugstr,char *url,char *userpass,char *command,char *params,int32_t timeout)
{
static CURL *curl_handle; static int didinit,count,count2; static double elapsedsum,elapsedsum2; extern int32_t USE_JAY;
CURL *curl_handle; static int didinit,count,count2; static double elapsedsum,elapsedsum2; extern int32_t USE_JAY;
struct MemoryStruct chunk;
struct curl_slist *headers = NULL; struct return_string s; CURLcode res;
char *bracket0,*bracket1,*retstr,*databuf = 0; long len; int32_t specialcase,numretries; double starttime;
@ -151,7 +151,7 @@ char *bitcoind_RPC(char **retstrp,char *debugstr,char *url,char *userpass,char *
{
didinit = 1;
curl_global_init(CURL_GLOBAL_ALL); //init the curl session
curl_handle = curl_easy_init();
//curl_handle = curl_easy_init();
}
if ( (0) && (USE_JAY != 0 && (strncmp(url,"http://127.0.0.1:7876/nxt",strlen("http://127.0.0.1:7876/nxt")) == 0 || strncmp(url,"https://127.0.0.1:7876/nxt",strlen("https://127.0.0.1:7876/nxt")) == 0)) )
{
@ -174,7 +174,7 @@ try_again:
if ( retstrp != 0 )
*retstrp = 0;
starttime = OS_milliseconds();
//curl_handle = curl_easy_init();
curl_handle = curl_easy_init();
headers = curl_slist_append(0,"Expect:");
curl_easy_setopt(curl_handle,CURLOPT_USERAGENT,"mozilla/4.0");//"Mozilla/4.0 (compatible; )");
@ -244,7 +244,7 @@ try_again:
//laststart = milliseconds();
res = curl_easy_perform(curl_handle);
curl_slist_free_all(headers);
//curl_easy_cleanup(curl_handle);
curl_easy_cleanup(curl_handle);
if ( databuf != 0 ) // clean up temporary buffer
{
free(databuf);

Loading…
Cancel
Save