From: Sebastian Harl Date: Wed, 28 Jul 2010 16:37:41 +0000 (+0200) Subject: patches: Removed bts557599_powerdns_fix -- applied upstream. X-Git-Tag: collectd-4.10.1-1~1 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=c7da18f45b2dbc3bf666ce2120be34690513f550;p=pkg-collectd.git patches: Removed bts557599_powerdns_fix -- applied upstream. --- diff --git a/debian/changelog b/debian/changelog index 9139412..72e3628 100644 --- a/debian/changelog +++ b/debian/changelog @@ -4,8 +4,9 @@ collectd (4.10.1-1) unstable; urgency=low * debian/patches: - Removed bts561577_collectd2html_recursive_fix -- applied upstream. - Removed bts575029-collectd2html-xhtml -- applied upstream. + - Removed bts557599_powerdns_fix -- applied upstream. - -- Sebastian Harl Wed, 28 Jul 2010 18:31:35 +0200 + -- Sebastian Harl Wed, 28 Jul 2010 18:37:25 +0200 collectd (4.10.0-1) unstable; urgency=low diff --git a/debian/patches/00list b/debian/patches/00list index 61d55b6..de365fe 100644 --- a/debian/patches/00list +++ b/debian/patches/00list @@ -1,5 +1,4 @@ rrd_filter_path.dpatch collection_conf_path.dpatch -bts557599_powerdns_fix.dpatch bts559801_plugin_find_fix.dpatch diff --git a/debian/patches/bts557599_powerdns_fix.dpatch b/debian/patches/bts557599_powerdns_fix.dpatch deleted file mode 100755 index 72b26c9..0000000 --- a/debian/patches/bts557599_powerdns_fix.dpatch +++ /dev/null @@ -1,73 +0,0 @@ -#! /bin/sh /usr/share/dpatch/dpatch-run -## bts557599_powerdns_fix.dpatch by Luke Heberling -## -## DP: powerdns plugin: Fixed communication when talking to pdns 2.9.22. -## DP: -## DP: powerdns version 2.9.22 (and above) require a newline at the end of -## DP: commands sent to the server. - -@DPATCH@ - -diff a/src/powerdns.c b/src/powerdns.c ---- a/src/powerdns.c -+++ b/src/powerdns.c -@@ -46,12 +46,12 @@ - #define FUNC_ERROR(func) do { char errbuf[1024]; ERROR ("powerdns plugin: %s failed: %s", func, sstrerror (errno, errbuf, sizeof (errbuf))); } while (0) - - #define SERVER_SOCKET LOCALSTATEDIR"/run/pdns.controlsocket" --#define SERVER_COMMAND "SHOW *" -+#define SERVER_COMMAND "SHOW * \n" - - #define RECURSOR_SOCKET LOCALSTATEDIR"/run/pdns_recursor.controlsocket" - #define RECURSOR_COMMAND "get noerror-answers nxdomain-answers " \ - "servfail-answers sys-msec user-msec qa-latency cache-entries cache-hits " \ -- "cache-misses questions" -+ "cache-misses questions\n" - - struct list_item_s; - typedef struct list_item_s list_item_t; -@@ -437,6 +437,11 @@ static int powerdns_get_data_stream (lis - return (-1); - } - -+ struct timeval timeout; -+ timeout.tv_sec=5; -+ timeout.tv_usec=0; -+ status = setsockopt (sd, SOL_SOCKET, SO_RCVTIMEO, &timeout, sizeof (timeout)); -+ - status = connect (sd, (struct sockaddr *) &item->sockaddr, - sizeof (item->sockaddr)); - if (status != 0) -@@ -529,7 +534,7 @@ static int powerdns_read_server (list_it - int fields_num; - - if (item->command == NULL) -- item->command = strdup ("SHOW *"); -+ item->command = strdup (SERVER_COMMAND); - if (item->command == NULL) - { - ERROR ("powerdns plugin: strdup failed."); -@@ -610,7 +615,7 @@ static int powerdns_update_recursor_comm - else - { - sstrncpy (buffer, "get ", sizeof (buffer)); -- status = strjoin (&buffer[4], sizeof (buffer) - strlen ("get "), -+ status = strjoin (&buffer[strlen("get ")], sizeof (buffer) - strlen ("get "), - li->fields, li->fields_num, - /* seperator = */ " "); - if (status < 0) -@@ -618,6 +623,14 @@ static int powerdns_update_recursor_comm - ERROR ("powerdns plugin: strjoin failed."); - return (-1); - } -+ buffer[sizeof (buffer) - 1] = 0; -+ int i = strlen (buffer); -+ if (i < sizeof (buffer) - 2) -+ { -+ buffer[i++] = ' '; -+ buffer[i++] = '\n'; -+ buffer[i++] = '\0'; -+ } - } - - buffer[sizeof (buffer) - 1] = 0;