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
4
dw_put_u16(packet,1,-1) == -1 /* QCLASS: 1 */) {
5
goto catch_handle_expired;
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
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 */
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
29
#include "DwStr_functions.h"
30
#include "DwRadioGatun.h"
36
+#include "DwSys.h" /* DwSys.h needs ip_addr_t */
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
46
/* Maximum number of open sockets; make this big like it is in *NIX */
48
#define FD_SETSIZE 512
49
+#endif /* FD_SETSIZE */
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
56
-/* Copyright (c) 2007-2009 Sam Trenholme
57
+/* Copyright (c) 2007-2010 Sam Trenholme
62
* fitness for purpose.
65
+#ifndef __DWSYS_H_DEFINED__
66
+#define __DWSYS_H_DEFINED__
79
+#include "DwSocket.h"
81
/* Parameters that are currently hardcoded in the source code (This will
82
* change once we get something very basic that works) */
87
+/* Log a char followed by an IP */
88
+void dw_log_ip(char *string, ip_addr_T *ip, int min_log_level);
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);
95
int32_t get_key_n(int32_t get, int32_t min, int32_t max, int32_t def);
97
+#endif /* __DWSYS_H_DEFINED__ */
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
102
-/* Copyright (c) 2007-2009 Sam Trenholme
103
+/* Copyright (c) 2007-2010 Sam Trenholme
111
+/* Log an IP; private */
112
+void dw_log_ip_p(ip_addr_T *ip) {
117
+ printf("%s","(null IP)\n");
119
+ fprintf(LOG,"%s","(null IP)\n");
125
+ for(counter = 0; counter < 3; counter++) {
127
+ printf("%d.",ip->ip[counter]);
129
+ fprintf(LOG,"%d.",ip->ip[counter]);
133
+ printf("%d ",ip->ip[3]);
135
+ fprintf(LOG,"%d ",ip->ip[3]);
138
+ } else if(ip->len == 16) {
139
+ for(counter = 0; counter < 15; counter++) {
141
+ printf("%02x:",ip->ip[counter]);
143
+ fprintf(LOG,"%02x:",ip->ip[counter]);
147
+ printf("%02x ",ip->ip[15]);
149
+ fprintf(LOG,"%02x ",ip->ip[15]);
154
+ printf("%s%d","IP of length ",ip->len);
156
+ fprintf(LOG,"%s%d","IP of length ",ip->len);
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) {
169
+ printf("%s ",string);
172
+ fprintf(LOG,"%s ",string);
180
+ fprintf(LOG,"%s","\n");
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];