Skip to content

Commit abeea84

Browse files
committed
修正(stns.c, stns.h): curlオプションの型をintからlongに変更
理由: curl_easy_setoptの引数としてlong型が必要なため、型を修正して 警告を防止し、コードの安定性を向上させるため。
1 parent e950238 commit abeea84

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

stns.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -314,8 +314,8 @@ static CURLcode inner_http_request(stns_conf_t *c, char *path, stns_response_t *
314314
}
315315
}
316316
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
317-
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, c->ssl_verify);
318-
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, c->ssl_verify);
317+
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, (long)c->ssl_verify);
318+
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, (long)c->ssl_verify);
319319
curl_easy_setopt(curl, CURLOPT_USERAGENT, STNS_VERSION_WITH_NAME);
320320
if (c->http_location == 1) {
321321
curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);
@@ -347,13 +347,13 @@ static CURLcode inner_http_request(stns_conf_t *c, char *path, stns_response_t *
347347
"http://unix", path);
348348
}
349349
curl_easy_setopt(curl, CURLOPT_URL, url);
350-
curl_easy_setopt(curl, CURLOPT_NOPROGRESS, 1);
351-
curl_easy_setopt(curl, CURLOPT_TIMEOUT, c->request_timeout);
350+
curl_easy_setopt(curl, CURLOPT_NOPROGRESS, 1L);
351+
curl_easy_setopt(curl, CURLOPT_TIMEOUT, (long)c->request_timeout);
352352
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, response_callback);
353353
curl_easy_setopt(curl, CURLOPT_HEADERFUNCTION, header_callback);
354354
curl_easy_setopt(curl, CURLOPT_WRITEDATA, res);
355355
curl_easy_setopt(curl, CURLOPT_HEADERDATA, c);
356-
curl_easy_setopt(curl, CURLOPT_NOSIGNAL, 1);
356+
curl_easy_setopt(curl, CURLOPT_NOSIGNAL, 1L);
357357

358358
#ifdef DEBUG
359359
syslog(LOG_ERR, "%s(stns)[L%d] before request http request: %s", __func__, __LINE__, url);

stns.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ struct stns_conf_t {
5858
char *query_wrapper;
5959
char *chain_ssh_wrapper;
6060
char *http_proxy;
61-
int http_location;
61+
long http_location;
6262
char *cache_dir;
6363
char *tls_cert;
6464
char *tls_key;
@@ -68,9 +68,9 @@ struct stns_conf_t {
6868
stns_user_httpheaders_t *http_headers;
6969
int uid_shift;
7070
int gid_shift;
71-
int ssl_verify;
71+
long ssl_verify;
7272
int use_cached;
73-
int request_timeout;
73+
long request_timeout;
7474
int request_retry;
7575
int request_locktime;
7676
int cache;

0 commit comments

Comments
 (0)