diff -Nru monitoring-plugins-2.2/debian/changelog monitoring-plugins-2.2/debian/changelog --- monitoring-plugins-2.2/debian/changelog 2019-10-31 00:21:55.000000000 +0000 +++ monitoring-plugins-2.2/debian/changelog 2020-05-02 06:43:05.000000000 +0000 @@ -1,3 +1,11 @@ +monitoring-plugins (2.2-6ubuntu2) groovy; urgency=medium + + [Haw Loeung] + * fix check_http - was having constant socket timeouts (LP: #1875517) + - d/p/14_check_http_socket_timeouts + + -- Rafael David Tinoco Sat, 02 May 2020 06:43:05 +0000 + monitoring-plugins (2.2-6ubuntu1) focal; urgency=medium * d/p/exclude-tmpfs-squashfs-tracefs.patch: Ignore artificial filesystems diff -Nru monitoring-plugins-2.2/debian/patches/16_check_http_socket_timeouts monitoring-plugins-2.2/debian/patches/16_check_http_socket_timeouts --- monitoring-plugins-2.2/debian/patches/16_check_http_socket_timeouts 1970-01-01 00:00:00.000000000 +0000 +++ monitoring-plugins-2.2/debian/patches/16_check_http_socket_timeouts 2020-05-02 06:43:05.000000000 +0000 @@ -0,0 +1,29 @@ +Description: fix check_http - was having constant socket timeouts + + [Backport] + Only the realloc() logic for the my_recv() buffer was backported. + It made signifiant performance improvements and was worth to be + backported. + +Author: Bryan Heden +Origin: backport, https://github.com/nagios-plugins/nagios-plugins/commit/2b38350d54 +Bug-Ubuntu: https://launchpad.net/bugs/1875517 +Reviewed-By: Rafael David Tinoco +Last-Update: 2020-05-02 + +--- monitoring-plugins-2.2.orig/plugins/check_http.c ++++ monitoring-plugins-2.2/plugins/check_http.c +@@ -1046,8 +1046,11 @@ check_http (void) + *pos = ' '; + } + buffer[i] = '\0'; +- xasprintf (&full_page_new, "%s%s", full_page, buffer); +- free (full_page); ++ ++ 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 + 1); + full_page = full_page_new; + pagesize += i; + diff -Nru monitoring-plugins-2.2/debian/patches/series monitoring-plugins-2.2/debian/patches/series --- monitoring-plugins-2.2/debian/patches/series 2019-10-31 00:21:55.000000000 +0000 +++ monitoring-plugins-2.2/debian/patches/series 2020-05-02 06:43:05.000000000 +0000 @@ -6,6 +6,7 @@ 13_check_apt_list_packages 14_mariadb 15_check_smtp_initialize +16_check_http_socket_timeouts # Ubuntu exclude-tmpfs-squashfs-tracefs.patch