diff options
Diffstat (limited to 'src/util')
-rw-r--r-- | src/util/test_resolver_api.c | 26 |
1 files changed, 0 insertions, 26 deletions
diff --git a/src/util/test_resolver_api.c b/src/util/test_resolver_api.c index 67d5f4640..fedbe8340 100644 --- a/src/util/test_resolver_api.c +++ b/src/util/test_resolver_api.c | |||
@@ -64,10 +64,8 @@ check_localhost_num (void *cls, const char *hostname) | |||
64 | return; | 64 | return; |
65 | if (0 == strcmp (hostname, "127.0.0.1")) | 65 | if (0 == strcmp (hostname, "127.0.0.1")) |
66 | { | 66 | { |
67 | #if DEBUG_RESOLVER | ||
68 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Received correct hostname `%s'.\n", | 67 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Received correct hostname `%s'.\n", |
69 | hostname); | 68 | hostname); |
70 | #endif | ||
71 | (*ok) &= ~4; | 69 | (*ok) &= ~4; |
72 | } | 70 | } |
73 | else | 71 | else |
@@ -88,10 +86,8 @@ check_localhost (void *cls, const char *hostname) | |||
88 | return; | 86 | return; |
89 | if (0 == strcmp (hostname, "localhost")) | 87 | if (0 == strcmp (hostname, "localhost")) |
90 | { | 88 | { |
91 | #if DEBUG_RESOLVER | ||
92 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Received correct hostname `%s'.\n", | 89 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Received correct hostname `%s'.\n", |
93 | hostname); | 90 | hostname); |
94 | #endif | ||
95 | (*ok) &= ~2; | 91 | (*ok) &= ~2; |
96 | } | 92 | } |
97 | else | 93 | else |
@@ -113,9 +109,7 @@ check_127 (void *cls, const struct sockaddr *sa, socklen_t salen) | |||
113 | GNUNET_assert (sizeof (struct sockaddr_in) == salen); | 109 | GNUNET_assert (sizeof (struct sockaddr_in) == salen); |
114 | if (sai->sin_addr.s_addr == htonl (INADDR_LOOPBACK)) | 110 | if (sai->sin_addr.s_addr == htonl (INADDR_LOOPBACK)) |
115 | { | 111 | { |
116 | #if DEBUG_RESOLVER | ||
117 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Received correct address.\n"); | 112 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Received correct address.\n"); |
118 | #endif | ||
119 | (*ok) &= ~1; | 113 | (*ok) &= ~1; |
120 | } | 114 | } |
121 | else | 115 | else |
@@ -142,10 +136,8 @@ check_local_fqdn (void *cls, const char *gnunet_fqdn) | |||
142 | "gethostname"); | 136 | "gethostname"); |
143 | return; | 137 | return; |
144 | } | 138 | } |
145 | #if DEBUG_RESOLVER | ||
146 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, _("Resolving our FQDN `%s'\n"), | 139 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, _("Resolving our FQDN `%s'\n"), |
147 | hostname); | 140 | hostname); |
148 | #endif | ||
149 | host = gethostbyname (hostname); | 141 | host = gethostbyname (hostname); |
150 | if (NULL == host) | 142 | if (NULL == host) |
151 | { | 143 | { |
@@ -180,18 +172,14 @@ check_rootserver_ip (void *cls, const struct sockaddr *sa, socklen_t salen) | |||
180 | 172 | ||
181 | if (0 == strcmp (inet_ntoa (sai->sin_addr), ROOTSERVER_IP)) | 173 | if (0 == strcmp (inet_ntoa (sai->sin_addr), ROOTSERVER_IP)) |
182 | { | 174 | { |
183 | #if DEBUG_RESOLVER | ||
184 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 175 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
185 | "Received correct rootserver ip address.\n"); | 176 | "Received correct rootserver ip address.\n"); |
186 | #endif | ||
187 | (*ok) &= ~1; | 177 | (*ok) &= ~1; |
188 | } | 178 | } |
189 | else | 179 | else |
190 | { | 180 | { |
191 | #if DEBUG_RESOLVER | ||
192 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 181 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
193 | "Received incorrect rootserver ip address.\n"); | 182 | "Received incorrect rootserver ip address.\n"); |
194 | #endif | ||
195 | GNUNET_break (0); | 183 | GNUNET_break (0); |
196 | } | 184 | } |
197 | } | 185 | } |
@@ -206,10 +194,8 @@ check_rootserver_name (void *cls, const char *hostname) | |||
206 | 194 | ||
207 | if (0 == strcmp (hostname, ROOTSERVER_NAME)) | 195 | if (0 == strcmp (hostname, ROOTSERVER_NAME)) |
208 | { | 196 | { |
209 | #if DEBUG_RESOLVER | ||
210 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 197 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
211 | "Received correct rootserver hostname `%s'.\n", hostname); | 198 | "Received correct rootserver hostname `%s'.\n", hostname); |
212 | #endif | ||
213 | (*ok) &= ~2; | 199 | (*ok) &= ~2; |
214 | } | 200 | } |
215 | else | 201 | else |
@@ -270,10 +256,8 @@ run (void *cls, char *const *args, const char *cfgfile, | |||
270 | count_ips++; | 256 | count_ips++; |
271 | if (count_ips > 1) | 257 | if (count_ips > 1) |
272 | { | 258 | { |
273 | #if DEBUG_RESOLVER | ||
274 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 259 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
275 | "IP received range for root name server, but a root name server has only 1 IP\n"); | 260 | "IP received range for root name server, but a root name server has only 1 IP\n"); |
276 | #endif | ||
277 | GNUNET_break (0); | 261 | GNUNET_break (0); |
278 | } | 262 | } |
279 | 263 | ||
@@ -286,11 +270,8 @@ run (void *cls, char *const *args, const char *cfgfile, | |||
286 | "IP received and IP for root name server differ\n"); | 270 | "IP received and IP for root name server differ\n"); |
287 | GNUNET_break (0); | 271 | GNUNET_break (0); |
288 | } | 272 | } |
289 | #if DEBUG_RESOLVER | ||
290 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, | 273 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, |
291 | "System's own forward name resolution is working\n"); | 274 | "System's own forward name resolution is working\n"); |
292 | #endif | ||
293 | |||
294 | /* Resolve the same using GNUNET */ | 275 | /* Resolve the same using GNUNET */ |
295 | GNUNET_RESOLVER_ip_get (ROOTSERVER_NAME, AF_INET, timeout, | 276 | GNUNET_RESOLVER_ip_get (ROOTSERVER_NAME, AF_INET, timeout, |
296 | &check_rootserver_ip, cls); | 277 | &check_rootserver_ip, cls); |
@@ -305,10 +286,8 @@ run (void *cls, char *const *args, const char *cfgfile, | |||
305 | rootserver->h_name = ""; | 286 | rootserver->h_name = ""; |
306 | if (1 != inet_pton (AF_INET, ROOTSERVER_IP, &rootserver_addr)) | 287 | if (1 != inet_pton (AF_INET, ROOTSERVER_IP, &rootserver_addr)) |
307 | { | 288 | { |
308 | #if DEBUG_RESOLVER | ||
309 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 289 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
310 | "Could not transform root name server IP address\n"); | 290 | "Could not transform root name server IP address\n"); |
311 | #endif | ||
312 | GNUNET_break (0); | 291 | GNUNET_break (0); |
313 | } | 292 | } |
314 | 293 | ||
@@ -326,19 +305,14 @@ run (void *cls, char *const *args, const char *cfgfile, | |||
326 | { | 305 | { |
327 | if (0 != strcmp (rootserver->h_name, ROOTSERVER_NAME)) | 306 | if (0 != strcmp (rootserver->h_name, ROOTSERVER_NAME)) |
328 | { | 307 | { |
329 | #if DEBUG_RESOLVER | ||
330 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 308 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
331 | "Received hostname and hostname for root name server differ\n"); | 309 | "Received hostname and hostname for root name server differ\n"); |
332 | #endif | ||
333 | GNUNET_break (0); | 310 | GNUNET_break (0); |
334 | } | 311 | } |
335 | } | 312 | } |
336 | 313 | ||
337 | #if DEBUG_RESOLVER | ||
338 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, | 314 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, |
339 | "System's own reverse name resolution is working\n"); | 315 | "System's own reverse name resolution is working\n"); |
340 | #endif | ||
341 | |||
342 | /* Resolve the same using GNUNET */ | 316 | /* Resolve the same using GNUNET */ |
343 | memset (&sa, 0, sizeof (sa)); | 317 | memset (&sa, 0, sizeof (sa)); |
344 | sa.sin_family = AF_INET; | 318 | sa.sin_family = AF_INET; |