FreeBSD Bugzilla – Attachment 212040 Details for
Bug 244510
net-mgmt/nagios-plugins: 2.3.2 breaks check_http for the -s, -r, and -R flags
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
revised patch
patch2.txt (text/plain), 3.02 KB, created by
Craig Leres
on 2020-02-29 02:08:12 UTC
(
hide
)
Description:
revised patch
Filename:
MIME Type:
Creator:
Craig Leres
Created:
2020-02-29 02:08:12 UTC
Size:
3.02 KB
patch
obsolete
>Index: net-mgmt/nagios-plugins/files/patch-plugins_check__http.c >=================================================================== >--- net-mgmt/nagios-plugins/files/patch-plugins_check__http.c (nonexistent) >+++ net-mgmt/nagios-plugins/files/patch-plugins_check__http.c (working copy) >@@ -0,0 +1,79 @@ >+--- plugins/check_http.c.orig 2020-02-20 19:14:52 UTC >++++ plugins/check_http.c >+@@ -608,11 +608,9 @@ enable_ssl: >+ >+ >+ >+-/* Returns 0 if we're still retrieving the headers. >+- * Otherwise, returns the length of the header (not including the final newlines) >+- */ >++/* Returns 1 if we're done processing the document body; 0 to keep going */ >+ static int >+-document_headers_done (const char *full_page) >++document_headers_done (char *full_page) >+ { >+ const char *body; >+ >+@@ -624,7 +622,8 @@ document_headers_done (const char *full_ >+ if (!*body) >+ return 0; /* haven't read end of headers yet */ >+ >+- return body - full_page; >++ full_page[body - full_page] = 0; >++ return 1; >+ } >+ >+ static time_t >+@@ -1014,10 +1013,6 @@ check_http (void) >+ char *page; >+ char *auth; >+ int http_status; >+- int header_end; >+- int content_length; >+- int content_start; >+- int seen_length; >+ int i = 0; >+ size_t pagesize = 0; >+ char *full_page; >+@@ -1200,40 +1195,11 @@ check_http (void) >+ full_page = full_page_new; >+ pagesize += i; >+ >+- header_end = document_headers_done(full_page); >+- if (header_end) { >++ if (no_body && document_headers_done (full_page)) { >+ i = 0; >+ break; >+ } >+ } >+- >+- if (no_body) { >+- full_page[header_end] = '\0'; >+- } >+- else { >+- content_length = get_content_length(full_page); >+- >+- content_start = header_end + 1; >+- while (full_page[content_start] == '\n' || full_page[content_start] == '\r') { >+- content_start += 1; >+- } >+- seen_length = pagesize - content_start; >+- /* Continue receiving the body until content-length is met */ >+- while (seen_length < content_length >+- && (i = my_recv(buffer, MAX_INPUT_BUFFER-1) > 0)) { >+- >+- buffer[i] = '\0'; >+- >+- if ((full_page_new = realloc(full_page, pagesize + i + 1)) == NULL) >+- die (STATE_UNKNOWN, _("HTTP UNKNOWN - Could not allocate memory for full_page\n")); >+- memmove(&full_page_new[pagesize], buffer, i); >+- full_page = full_page_new; >+- >+- pagesize += i; >+- seen_length = pagesize - content_start; >+- } >+- } >+- >+ microsec_transfer = deltime (tv_temp); >+ elapsed_time_transfer = (double)microsec_transfer / 1.0e6; >+ > >Property changes on: net-mgmt/nagios-plugins/files/patch-plugins_check__http.c >___________________________________________________________________ >Added: fbsd:nokeywords >## -0,0 +1 ## >+yes >\ No newline at end of property >Added: svn:eol-style >## -0,0 +1 ## >+native >\ No newline at end of property >Added: svn:mime-type >## -0,0 +1 ## >+text/plain >\ No newline at end of property
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
leres
:
maintainer-approval?
Actions:
View
|
Diff
Attachments on
bug 244510
:
212036
| 212040