diff options
author | Christian Grothoff <christian@grothoff.org> | 2012-01-28 07:27:58 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2012-01-28 07:27:58 +0000 |
commit | bdf5057504117e11a691a7fcef4f9df631213d0b (patch) | |
tree | 4b3343a64e307aaa8400a8a0dfe16b8901f5b711 /src/util/test_resolver_api.c | |
parent | fbd944e17bdd8004bc4672070615743c76d01546 (diff) | |
download | gnunet-bdf5057504117e11a691a7fcef4f9df631213d0b.tar.gz gnunet-bdf5057504117e11a691a7fcef4f9df631213d0b.zip |
-log resolver errors always
Diffstat (limited to 'src/util/test_resolver_api.c')
-rw-r--r-- | src/util/test_resolver_api.c | 29 |
1 files changed, 10 insertions, 19 deletions
diff --git a/src/util/test_resolver_api.c b/src/util/test_resolver_api.c index c96030698..d23bddbd5 100644 --- a/src/util/test_resolver_api.c +++ b/src/util/test_resolver_api.c | |||
@@ -72,10 +72,8 @@ check_localhost_num (void *cls, const char *hostname) | |||
72 | } | 72 | } |
73 | else | 73 | else |
74 | { | 74 | { |
75 | #if DEBUG_RESOLVER | 75 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Received invalid hostname `%s'.\n", |
76 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Received invalid hostname `%s'.\n", | ||
77 | hostname); | 76 | hostname); |
78 | #endif | ||
79 | GNUNET_break (0); | 77 | GNUNET_break (0); |
80 | } | 78 | } |
81 | } | 79 | } |
@@ -122,9 +120,10 @@ check_127 (void *cls, const struct sockaddr *sa, socklen_t salen) | |||
122 | } | 120 | } |
123 | else | 121 | else |
124 | { | 122 | { |
125 | #if DEBUG_RESOLVER | 123 | char buf[INET_ADDRSTRLEN]; |
126 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Received incorrect address.\n"); | 124 | |
127 | #endif | 125 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Received incorrect address`%s'.\n", |
126 | inet_ntop (AF_INET, &sai->sin_addr, buf, sizeof (buf))); | ||
128 | GNUNET_break (0); | 127 | GNUNET_break (0); |
129 | } | 128 | } |
130 | } | 129 | } |
@@ -151,7 +150,7 @@ check_local_fqdn (void *cls, const char *gnunet_fqdn) | |||
151 | if (NULL == host) | 150 | if (NULL == host) |
152 | { | 151 | { |
153 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | 152 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |
154 | _("Could not resolve our FQDN : %s %u\n"), hstrerror (h_errno), | 153 | _("Could not resolve our FQDN: %s %u\n"), hstrerror (h_errno), |
155 | h_errno); | 154 | h_errno); |
156 | return; | 155 | return; |
157 | } | 156 | } |
@@ -215,10 +214,8 @@ check_rootserver_name (void *cls, const char *hostname) | |||
215 | } | 214 | } |
216 | else | 215 | else |
217 | { | 216 | { |
218 | #if DEBUG_RESOLVER | 217 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |
219 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
220 | "Received invalid rootserver hostname `%s'.\n", hostname); | 218 | "Received invalid rootserver hostname `%s'.\n", hostname); |
221 | #endif | ||
222 | GNUNET_break (0); | 219 | GNUNET_break (0); |
223 | } | 220 | } |
224 | } | 221 | } |
@@ -259,11 +256,9 @@ run (void *cls, char *const *args, const char *cfgfile, | |||
259 | if (rootserver == NULL) | 256 | if (rootserver == NULL) |
260 | { | 257 | { |
261 | /* Error: resolving ip addresses does not work */ | 258 | /* Error: resolving ip addresses does not work */ |
262 | #if DEBUG_RESOLVER | 259 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |
263 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, | ||
264 | _("gethostbyname() could not lookup IP address: %s\n"), | 260 | _("gethostbyname() could not lookup IP address: %s\n"), |
265 | hstrerror (h_errno)); | 261 | hstrerror (h_errno)); |
266 | #endif | ||
267 | FPRINTF (stderr, | 262 | FPRINTF (stderr, |
268 | "%s", "System seems to be off-line, will not run all DNS tests\n"); | 263 | "%s", "System seems to be off-line, will not run all DNS tests\n"); |
269 | *ok = 0; /* mark test as passing anyway */ | 264 | *ok = 0; /* mark test as passing anyway */ |
@@ -287,10 +282,8 @@ run (void *cls, char *const *args, const char *cfgfile, | |||
287 | (inet_ntoa (*(struct in_addr *) rootserver->h_addr_list[0]), | 282 | (inet_ntoa (*(struct in_addr *) rootserver->h_addr_list[0]), |
288 | ROOTSERVER_IP) != 0) | 283 | ROOTSERVER_IP) != 0) |
289 | { | 284 | { |
290 | #if DEBUG_RESOLVER | 285 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |
291 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
292 | "IP received and IP for root name server differ\n"); | 286 | "IP received and IP for root name server differ\n"); |
293 | #endif | ||
294 | GNUNET_break (0); | 287 | GNUNET_break (0); |
295 | } | 288 | } |
296 | #if DEBUG_RESOLVER | 289 | #if DEBUG_RESOLVER |
@@ -324,11 +317,9 @@ run (void *cls, char *const *args, const char *cfgfile, | |||
324 | if (rootserver == NULL) | 317 | if (rootserver == NULL) |
325 | { | 318 | { |
326 | /* Error: resolving IP addresses does not work */ | 319 | /* Error: resolving IP addresses does not work */ |
327 | #if DEBUG_RESOLVER | 320 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |
328 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, | ||
329 | _("gethostbyaddr() could not lookup hostname: %s\n"), | 321 | _("gethostbyaddr() could not lookup hostname: %s\n"), |
330 | hstrerror (h_errno)); | 322 | hstrerror (h_errno)); |
331 | #endif | ||
332 | GNUNET_break (0); | 323 | GNUNET_break (0); |
333 | } | 324 | } |
334 | else | 325 | else |