~ubuntu-branches/ubuntu/trusty/maradns/trusty-proposed

« back to all changes in this revision

Viewing changes to deadwood-3.2.02/update/2.9.03/deadwood-2.9.02-log_retry.patch

  • Committer: Package Import Robot
  • Author(s): Nicholas Bamber
  • Date: 2012-03-14 08:45:48 UTC
  • mfrom: (1.2.9)
  • Revision ID: package-import@ubuntu.com-20120314084548-6slw035p8443a19q
Tags: 1.4.11-1
* New upstream release
* Removed changelog patch
* Added to docs rules to fix missing faq.txt
* Raised standards version to 3.9.3
  - Updated debian/copyright format
  - Removed lintian override
  - Changed working directories from /var/run to /run

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
--- deadwood-2.9.03/src/DwSocket.c.orig 2010-08-06 05:50:57.000000000 -0700
 
2
+++ deadwood-2.9.03/src/DwSocket.c      2010-08-06 06:05:48.000000000 -0700
 
3
@@ -826,6 +826,8 @@
 
4
                    dw_put_u16(packet,1,-1) == -1 /* QCLASS: 1 */) {
 
5
                         goto catch_handle_expired;
 
6
                 }
 
7
+               dw_log_dwstr_str("Connection for query ",rem[a].query,
 
8
+                               " did not respond; trying again",128);
 
9
                 make_remote_connection(a,(unsigned char *)packet->str,
 
10
                                 packet->len,rem[a].query,INVALID_SOCKET);
 
11
                 rem[a].die = get_time() + ((int64_t)timeout_seconds << 8);
 
12
--- deadwood-2.9.03/src/DwUdpSocket.c.orig      2010-08-06 06:06:03.000000000 -0700
 
13
+++ deadwood-2.9.03/src/DwUdpSocket.c   2010-08-06 06:07:02.000000000 -0700
 
14
@@ -197,6 +197,7 @@
 
15
 
 
16
         /* Get IP of remote server and open a socket to them */
 
17
         addr = get_upstream_ip(query,n);
 
18
+       dw_log_ip("Making connection to IP",&addr,128);
 
19
         if(addr.len == 0) { /* Failed to get upstream IP */
 
20
                 return;
 
21
         } else if(addr.len == 4 || addr.len == 16) { /* IPv4/IPv6 IP */
 
22
--- deadwood-2.9.03/src/DwSocket.h.orig 2010-07-29 10:39:10.000000000 -0700
 
23
+++ deadwood-2.9.03/src/DwSocket.h      2010-08-06 06:23:14.000000000 -0700
 
24
@@ -39,7 +39,6 @@
 
25
 
 
26
 #include "DwStr.h"
 
27
 #include "DwMararc.h"
 
28
-#include "DwSys.h"
 
29
 #include "DwStr_functions.h"
 
30
 #include "DwRadioGatun.h"
 
31
 #include "DwHash.h"
 
32
@@ -99,6 +98,8 @@
 
33
         uint8_t flags;
 
34
 } ip_addr_T;
 
35
 
 
36
+#include "DwSys.h" /* DwSys.h needs ip_addr_t */
 
37
+
 
38
 /* Structure for storing an IP address *and* a netmask; note that the
 
39
  * beginning of the structure *must* have the exact same form as the
 
40
  * ip_addr_T structure above */
 
41
--- deadwood-2.9.03/src/DwSocket.h.orig 2010-08-06 06:38:16.000000000 -0700
 
42
+++ deadwood-2.9.03/src/DwSocket.h      2010-08-06 06:38:50.000000000 -0700
 
43
@@ -54,7 +54,9 @@
 
44
 #include <grp.h>
 
45
 #else  /* MINGW */
 
46
 /* Maximum number of open sockets; make this big like it is in *NIX */
 
47
+#ifndef FD_SETSIZE
 
48
 #define FD_SETSIZE 512
 
49
+#endif /* FD_SETSIZE */
 
50
 #include <winsock.h>
 
51
 #include <wininet.h>
 
52
 #endif /* MINGW */
 
53
--- deadwood-2.9.03/src/DwSys.h.orig    2010-08-06 06:40:52.000000000 -0700
 
54
+++ deadwood-2.9.03/src/DwSys.h 2010-08-06 06:41:24.000000000 -0700
 
55
@@ -1,4 +1,4 @@
 
56
-/* Copyright (c) 2007-2009 Sam Trenholme
 
57
+/* Copyright (c) 2007-2010 Sam Trenholme
 
58
  *
 
59
  * TERMS
 
60
  *
 
61
@@ -16,14 +16,18 @@
 
62
  * fitness for purpose.
 
63
  */
 
64
 
 
65
+#ifndef __DWSYS_H_DEFINED__
 
66
+#define __DWSYS_H_DEFINED__
 
67
+
 
68
+#ifndef MINGW
 
69
+#include <grp.h>
 
70
+#endif /* MINGW */
 
71
 #include <stdio.h>
 
72
 #include <string.h>
 
73
 #include <unistd.h>
 
74
 #include <fcntl.h>
 
75
 #include <time.h>
 
76
-#ifndef MINGW
 
77
-#include <grp.h>
 
78
-#endif /* MINGW */
 
79
+#include "DwSocket.h"
 
80
 
 
81
 /* Parameters that are currently hardcoded in the source code (This will
 
82
  * change once we get something very basic that works) */
 
83
@@ -47,6 +51,9 @@
 
84
 /* Close the log */
 
85
 void dw_log_close();
 
86
 
 
87
+/* Log a char followed by an IP */
 
88
+void dw_log_ip(char *string, ip_addr_T *ip, int min_log_level);
 
89
+
 
90
 /* Log a string followed by the contents of a DwStr object */
 
91
 void dw_log_dwstr(char *s1, dw_str *s2, int min_log_level);
 
92
 
 
93
@@ -139,3 +146,5 @@
 
94
  * the def value */
 
95
 int32_t get_key_n(int32_t get, int32_t min, int32_t max, int32_t def);
 
96
 
 
97
+#endif /* __DWSYS_H_DEFINED__ */
 
98
+
 
99
--- deadwood-2.9.03/src/DwSys.c.orig    2010-08-06 08:02:05.000000000 -0700
 
100
+++ deadwood-2.9.03/src/DwSys.c 2010-08-06 08:03:09.000000000 -0700
 
101
@@ -1,4 +1,4 @@
 
102
-/* Copyright (c) 2007-2009 Sam Trenholme
 
103
+/* Copyright (c) 2007-2010 Sam Trenholme
 
104
  *
 
105
  * TERMS
 
106
  *
 
107
@@ -126,6 +126,80 @@
 
108
         }
 
109
 }
 
110
 
 
111
+/* Log an IP; private */
 
112
+void dw_log_ip_p(ip_addr_T *ip) {
 
113
+       int counter = 0;
 
114
+
 
115
+       if(ip == 0) {
 
116
+#ifndef MINGW
 
117
+               printf("%s","(null IP)\n");
 
118
+#else /* MINGW */
 
119
+               fprintf(LOG,"%s","(null IP)\n");
 
120
+#endif /* MINGW */
 
121
+               return;
 
122
+       }
 
123
+
 
124
+       if(ip->len == 4) {
 
125
+               for(counter = 0; counter < 3; counter++) {
 
126
+#ifndef MINGW
 
127
+                       printf("%d.",ip->ip[counter]);
 
128
+#else /* MINGW */
 
129
+                       fprintf(LOG,"%d.",ip->ip[counter]);
 
130
+#endif /* MINGW */
 
131
+               }
 
132
+#ifndef MINGW
 
133
+               printf("%d ",ip->ip[3]);
 
134
+#else /* MINGW */
 
135
+               fprintf(LOG,"%d ",ip->ip[3]);
 
136
+#endif /* MINGW */
 
137
+#ifdef IPV6
 
138
+       } else if(ip->len == 16) {
 
139
+               for(counter = 0; counter < 15; counter++) {
 
140
+#ifndef MINGW
 
141
+                       printf("%02x:",ip->ip[counter]);
 
142
+#else /* MINGW */
 
143
+                       fprintf(LOG,"%02x:",ip->ip[counter]);
 
144
+#endif /* MINGW */
 
145
+               }
 
146
+#ifndef MINGW
 
147
+               printf("%02x ",ip->ip[15]);
 
148
+#else /* MINGW */
 
149
+               fprintf(LOG,"%02x ",ip->ip[15]);
 
150
+#endif /* MINGW */
 
151
+#endif /* IPV6 */
 
152
+       } else {
 
153
+#ifndef MINGW
 
154
+               printf("%s%d","IP of length ",ip->len);
 
155
+#else /* MINGW */
 
156
+               fprintf(LOG,"%s%d","IP of length ",ip->len);
 
157
+#endif /* MINGW */
 
158
+       }
 
159
+}              
 
160
+
 
161
+/* Log a char followed by an IP */
 
162
+void dw_log_ip(char *string, ip_addr_T *ip, int min_log_level) {
 
163
+        int32_t ll = key_n[DWM_N_verbose_level];
 
164
+        if(ll <= 0 || ll < min_log_level) {
 
165
+                return;
 
166
+        }
 
167
+
 
168
+#ifndef MINGW
 
169
+        printf("%s ",string);
 
170
+#else /* MINGW */
 
171
+        dw_win_time();
 
172
+        fprintf(LOG,"%s ",string);
 
173
+#endif /* MINGW */
 
174
+
 
175
+       dw_log_ip_p(ip);
 
176
+
 
177
+#ifndef MINGW
 
178
+        printf("%s","\n");
 
179
+#else /* MINGW */
 
180
+        fprintf(LOG,"%s","\n");
 
181
+#endif /* MINGW */
 
182
+       
 
183
+}
 
184
+
 
185
 /* Log a string followed by the contents of a DwStr object */
 
186
 void dw_log_dwstr(char *s1, dw_str *s2, int min_log_level) {
 
187
         int32_t ll = key_n[DWM_N_verbose_level];