diff options
author | Lorenz Kästle <12514511+RincewindsHat@users.noreply.github.com> | 2023-10-15 19:56:54 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-15 19:56:54 (GMT) |
commit | 15b4e89a42a3caf2c4da3992d698b356649665a1 (patch) | |
tree | 746601853c70c7d097ea4b97780d797d2daced21 | |
parent | fff1014d1323980d5e969f31a5a17132482422ac (diff) | |
parent | ceb614aad46423170e284e66023c7a2e8c513338 (diff) | |
download | monitoring-plugins-15b4e89a42a3caf2c4da3992d698b356649665a1.tar.gz |
Merge pull request #1938 from RincewindsHat/compiler_warnings_unused
check_curl: fix compiler warnings for unused variables
-rw-r--r-- | plugins/check_curl.c | 14 | ||||
-rw-r--r-- | plugins/check_ldap.c | 3 |
2 files changed, 12 insertions, 5 deletions
diff --git a/plugins/check_curl.c b/plugins/check_curl.c index da578b5..153e492 100644 --- a/plugins/check_curl.c +++ b/plugins/check_curl.c | |||
@@ -1218,6 +1218,10 @@ redir (curlhelp_write_curlbuf* header_buf) | |||
1218 | &status_line.http_major, &status_line.http_minor, &status_line.http_code, &status_line.msg, &msglen, | 1218 | &status_line.http_major, &status_line.http_minor, &status_line.http_code, &status_line.msg, &msglen, |
1219 | headers, &nof_headers, 0); | 1219 | headers, &nof_headers, 0); |
1220 | 1220 | ||
1221 | if (res == -1) { | ||
1222 | die (STATE_UNKNOWN, _("HTTP UNKNOWN - Failed to parse Response\n")); | ||
1223 | } | ||
1224 | |||
1221 | location = get_header_value (headers, nof_headers, "location"); | 1225 | location = get_header_value (headers, nof_headers, "location"); |
1222 | 1226 | ||
1223 | if (verbose >= 2) | 1227 | if (verbose >= 2) |
@@ -2388,6 +2392,10 @@ check_document_dates (const curlhelp_write_curlbuf *header_buf, char (*msg)[DEFA | |||
2388 | &status_line.http_major, &status_line.http_minor, &status_line.http_code, &status_line.msg, &msglen, | 2392 | &status_line.http_major, &status_line.http_minor, &status_line.http_code, &status_line.msg, &msglen, |
2389 | headers, &nof_headers, 0); | 2393 | headers, &nof_headers, 0); |
2390 | 2394 | ||
2395 | if (res == -1) { | ||
2396 | die (STATE_UNKNOWN, _("HTTP UNKNOWN - Failed to parse Response\n")); | ||
2397 | } | ||
2398 | |||
2391 | server_date = get_header_value (headers, nof_headers, "date"); | 2399 | server_date = get_header_value (headers, nof_headers, "date"); |
2392 | document_date = get_header_value (headers, nof_headers, "last-modified"); | 2400 | document_date = get_header_value (headers, nof_headers, "last-modified"); |
2393 | 2401 | ||
@@ -2463,9 +2471,7 @@ check_document_dates (const curlhelp_write_curlbuf *header_buf, char (*msg)[DEFA | |||
2463 | int | 2471 | int |
2464 | get_content_length (const curlhelp_write_curlbuf* header_buf, const curlhelp_write_curlbuf* body_buf) | 2472 | get_content_length (const curlhelp_write_curlbuf* header_buf, const curlhelp_write_curlbuf* body_buf) |
2465 | { | 2473 | { |
2466 | const char *s; | ||
2467 | int content_length = 0; | 2474 | int content_length = 0; |
2468 | char *copy; | ||
2469 | struct phr_header headers[255]; | 2475 | struct phr_header headers[255]; |
2470 | size_t nof_headers = 255; | 2476 | size_t nof_headers = 255; |
2471 | size_t msglen; | 2477 | size_t msglen; |
@@ -2476,6 +2482,10 @@ get_content_length (const curlhelp_write_curlbuf* header_buf, const curlhelp_wri | |||
2476 | &status_line.http_major, &status_line.http_minor, &status_line.http_code, &status_line.msg, &msglen, | 2482 | &status_line.http_major, &status_line.http_minor, &status_line.http_code, &status_line.msg, &msglen, |
2477 | headers, &nof_headers, 0); | 2483 | headers, &nof_headers, 0); |
2478 | 2484 | ||
2485 | if (res == -1) { | ||
2486 | die (STATE_UNKNOWN, _("HTTP UNKNOWN - Failed to parse Response\n")); | ||
2487 | } | ||
2488 | |||
2479 | content_length_s = get_header_value (headers, nof_headers, "content-length"); | 2489 | content_length_s = get_header_value (headers, nof_headers, "content-length"); |
2480 | if (!content_length_s) { | 2490 | if (!content_length_s) { |
2481 | return header_buf->buflen + body_buf->buflen; | 2491 | return header_buf->buflen + body_buf->buflen; |
diff --git a/plugins/check_ldap.c b/plugins/check_ldap.c index a1bfe1b..15113b1 100644 --- a/plugins/check_ldap.c +++ b/plugins/check_ldap.c | |||
@@ -97,9 +97,6 @@ main (int argc, char *argv[]) | |||
97 | int tls; | 97 | int tls; |
98 | int version=3; | 98 | int version=3; |
99 | 99 | ||
100 | /* for entry counting */ | ||
101 | |||
102 | LDAPMessage *next_entry; | ||
103 | int status_entries = STATE_OK; | 100 | int status_entries = STATE_OK; |
104 | int num_entries = 0; | 101 | int num_entries = 0; |
105 | 102 | ||