diff options
Diffstat (limited to 'plugins/check_curl.c')
-rw-r--r-- | plugins/check_curl.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/plugins/check_curl.c b/plugins/check_curl.c index da578b55..153e492f 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; |