Skip to content

Commit 4231c89

Browse files
committed
Bugfix: jsonrpc: curl_easy_setopt numbers need to be long type
1 parent c361b37 commit 4231c89

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

src/datum_jsonrpc.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -107,13 +107,13 @@ char *basic_http_call(CURL *curl, const char *url) {
107107

108108
curl_easy_setopt(curl, CURLOPT_URL, url);
109109
curl_easy_setopt(curl, CURLOPT_ENCODING, "");
110-
curl_easy_setopt(curl, CURLOPT_FAILONERROR, 1);
111-
curl_easy_setopt(curl, CURLOPT_TCP_NODELAY, 1);
110+
curl_easy_setopt(curl, CURLOPT_FAILONERROR, 1L);
111+
curl_easy_setopt(curl, CURLOPT_TCP_NODELAY, 1L);
112112
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, all_data_cb);
113113
curl_easy_setopt(curl, CURLOPT_WRITEDATA, &all_data);
114114
curl_easy_setopt(curl, CURLOPT_ERRORBUFFER, curl_err_str);
115-
curl_easy_setopt(curl, CURLOPT_CONNECTTIMEOUT, 5); // quick timeout!
116-
curl_easy_setopt(curl, CURLOPT_TIMEOUT, 5); // quick timeout!
115+
curl_easy_setopt(curl, CURLOPT_CONNECTTIMEOUT, 5L); // quick timeout!
116+
curl_easy_setopt(curl, CURLOPT_TIMEOUT, 5L); // quick timeout!
117117
curl_easy_setopt(curl, CURLOPT_NOSIGNAL, 1L);
118118

119119
rc = curl_easy_perform(curl);
@@ -150,23 +150,23 @@ json_t *json_rpc_call_full(CURL *curl, const char *url, const char *userpass, co
150150

151151
curl_easy_setopt(curl, CURLOPT_URL, url);
152152
curl_easy_setopt(curl, CURLOPT_ENCODING, "");
153-
curl_easy_setopt(curl, CURLOPT_FAILONERROR, 1);
154-
curl_easy_setopt(curl, CURLOPT_TCP_NODELAY, 1);
153+
curl_easy_setopt(curl, CURLOPT_FAILONERROR, 1L);
154+
curl_easy_setopt(curl, CURLOPT_TCP_NODELAY, 1L);
155155
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, all_data_cb);
156156
curl_easy_setopt(curl, CURLOPT_WRITEDATA, &all_data);
157157
curl_easy_setopt(curl, CURLOPT_READFUNCTION, upload_data_cb);
158158
curl_easy_setopt(curl, CURLOPT_READDATA, &upload_data);
159159
curl_easy_setopt(curl, CURLOPT_ERRORBUFFER, curl_err_str);
160-
curl_easy_setopt(curl, CURLOPT_CONNECTTIMEOUT, 5); // quick timeout!
161-
curl_easy_setopt(curl, CURLOPT_TIMEOUT, 5); // quick timeout!
160+
curl_easy_setopt(curl, CURLOPT_CONNECTTIMEOUT, 5L); // quick timeout!
161+
curl_easy_setopt(curl, CURLOPT_TIMEOUT, 5L); // quick timeout!
162162
curl_easy_setopt(curl, CURLOPT_NOSIGNAL, 1L);
163163

164164
if (userpass) {
165165
curl_easy_setopt(curl, CURLOPT_USERPWD, userpass);
166166
curl_easy_setopt(curl, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
167167
}
168168

169-
curl_easy_setopt(curl, CURLOPT_POST, 1);
169+
curl_easy_setopt(curl, CURLOPT_POST, 1L);
170170

171171
upload_data.buf = rpc_req;
172172
upload_data.len = strlen(rpc_req);

0 commit comments

Comments
 (0)