Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions src/httppower/httppower.c
Original file line number Diff line number Diff line change
Expand Up @@ -88,15 +88,15 @@ void post(CURL *h, char **av)
}

if (postdata && url_ptr) {
curl_easy_setopt(h, CURLOPT_POST, 1);
curl_easy_setopt(h, CURLOPT_POST, 1L);
curl_easy_setopt(h, CURLOPT_URL, url_ptr);
curl_easy_setopt(h, CURLOPT_POSTFIELDS, postdata);
curl_easy_setopt(h, CURLOPT_POSTFIELDSIZE, strlen (postdata));
if (curl_easy_perform(h) != 0)
printf("Error: %s\n", errbuf);
curl_easy_setopt(h, CURLOPT_URL, "");
curl_easy_setopt(h, CURLOPT_POSTFIELDS, "");
curl_easy_setopt(h, CURLOPT_POSTFIELDSIZE, 0);
curl_easy_setopt(h, CURLOPT_POSTFIELDSIZE, 0L);
} else
printf("Nothing to post!\n");

Expand Down Expand Up @@ -137,7 +137,7 @@ void put(CURL *h, char **av)
}

if (putdata && url_ptr) {
curl_easy_setopt(h, CURLOPT_UPLOAD, 1);
curl_easy_setopt(h, CURLOPT_UPLOAD, 1L);
curl_easy_setopt(h, CURLOPT_URL, url_ptr);
curl_easy_setopt(h, CURLOPT_READFUNCTION, put_read_cb);
pcd.data = putdata;
Expand All @@ -147,7 +147,7 @@ void put(CURL *h, char **av)
if (curl_easy_perform(h) != 0)
printf("Error: %s\n", errbuf);
curl_easy_setopt(h, CURLOPT_URL, "");
curl_easy_setopt(h, CURLOPT_UPLOAD, 0);
curl_easy_setopt(h, CURLOPT_UPLOAD, 0L);
} else
printf("Nothing to put!\n");

Expand All @@ -162,7 +162,7 @@ void get(CURL *h, char **av)
char *myurl = _make_url(av[0]);

if (myurl) {
curl_easy_setopt(h, CURLOPT_HTTPGET, 1);
curl_easy_setopt(h, CURLOPT_HTTPGET, 1L);
curl_easy_setopt(h, CURLOPT_URL, myurl);
if (curl_easy_perform(h) != 0)
printf("Error: %s\n", errbuf);
Expand Down Expand Up @@ -324,9 +324,9 @@ main(int argc, char *argv[])
if ((h = curl_easy_init()) == NULL)
err_exit(false, "curl_easy_init failed");

curl_easy_setopt(h, CURLOPT_TIMEOUT, 5);
curl_easy_setopt(h, CURLOPT_TIMEOUT, 5L);
curl_easy_setopt(h, CURLOPT_ERRORBUFFER, errbuf);
curl_easy_setopt(h, CURLOPT_FAILONERROR, 1);
curl_easy_setopt(h, CURLOPT_FAILONERROR, 1L);

/* for time being */
curl_easy_setopt(h, CURLOPT_SSL_VERIFYPEER, 0L);
Expand Down
8 changes: 4 additions & 4 deletions src/redfishpower/redfishpower.c
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ static void powermsg_init_curl(struct powermsg *pm)
/* Per documentation, CURLOPT_TIMEOUT overrides
* CURLOPT_CONNECTTIMEOUT */
Curl_easy_setopt((pm->eh, CURLOPT_TIMEOUT, message_timeout));
Curl_easy_setopt((pm->eh, CURLOPT_FAILONERROR, 1));
Curl_easy_setopt((pm->eh, CURLOPT_FAILONERROR, 1L));

/* for time being */
Curl_easy_setopt((pm->eh, CURLOPT_SSL_VERIFYPEER, 0L));
Expand Down Expand Up @@ -321,12 +321,12 @@ static void powermsg_init_curl(struct powermsg *pm)
Curl_easy_setopt((pm->eh, CURLOPT_URL, pm->url));

if (pm->postdata) {
Curl_easy_setopt((pm->eh, CURLOPT_POST, 1));
Curl_easy_setopt((pm->eh, CURLOPT_POST, 1L));
Curl_easy_setopt((pm->eh, CURLOPT_POSTFIELDS, pm->postdata));
Curl_easy_setopt((pm->eh, CURLOPT_POSTFIELDSIZE, strlen(pm->postdata)));
}
else
Curl_easy_setopt((pm->eh, CURLOPT_HTTPGET, 1));
Curl_easy_setopt((pm->eh, CURLOPT_HTTPGET, 1L));
}

static char *resolve_hosts_url(const char *hostname, const char *path)
Expand Down Expand Up @@ -1221,7 +1221,7 @@ static void power_cleanup(struct powermsg *pm)
{
if (!test_mode && pm->eh) {
Curl_easy_setopt((pm->eh, CURLOPT_POSTFIELDS, ""));
Curl_easy_setopt((pm->eh, CURLOPT_POSTFIELDSIZE, 0));
Curl_easy_setopt((pm->eh, CURLOPT_POSTFIELDSIZE, 0L));
}
powermsg_destroy(pm);
}
Expand Down