|
|
@ -61,24 +61,6 @@ static size_t all_data_cb(const void *ptr, size_t size, size_t nmemb, |
|
|
|
return len; |
|
|
|
return len; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
static size_t upload_data_cb(void *ptr, size_t size, size_t nmemb, |
|
|
|
|
|
|
|
void *user_data) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
struct upload_buffer *ub = user_data; |
|
|
|
|
|
|
|
int len = size * nmemb; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (len > ub->len) |
|
|
|
|
|
|
|
len = ub->len; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (len) { |
|
|
|
|
|
|
|
memcpy(ptr, ub->buf, len); |
|
|
|
|
|
|
|
ub->buf += len; |
|
|
|
|
|
|
|
ub->len -= len; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return len; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
json_t *json_rpc_call(const char *url, const char *userpass, const char *rpc_req) |
|
|
|
json_t *json_rpc_call(const char *url, const char *userpass, const char *rpc_req) |
|
|
|
{ |
|
|
|
{ |
|
|
|
CURL *curl; |
|
|
|
CURL *curl; |
|
|
|