aboutsummaryrefslogtreecommitdiff
path: root/src/util/test_resolver_api.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2011-08-15 21:54:06 +0000
committerChristian Grothoff <christian@grothoff.org>2011-08-15 21:54:06 +0000
commit5746309cb4be2073d550ad7a6885e918631dbc38 (patch)
tree89455bc4aadf977816b38df13f990372cd81d71a /src/util/test_resolver_api.c
parent6fd3e715cae09fa6e657c96f1c6f9711ee51f42f (diff)
downloadgnunet-5746309cb4be2073d550ad7a6885e918631dbc38.tar.gz
gnunet-5746309cb4be2073d550ad7a6885e918631dbc38.zip
indentation
Diffstat (limited to 'src/util/test_resolver_api.c')
-rw-r--r--src/util/test_resolver_api.c37
1 files changed, 19 insertions, 18 deletions
diff --git a/src/util/test_resolver_api.c b/src/util/test_resolver_api.c
index 8058fa287..563f204eb 100644
--- a/src/util/test_resolver_api.c
+++ b/src/util/test_resolver_api.c
@@ -65,16 +65,16 @@ check_localhost_num (void *cls, const char *hostname)
65 if (0 == strcmp (hostname, "127.0.0.1")) 65 if (0 == strcmp (hostname, "127.0.0.1"))
66 { 66 {
67#if DEBUG_RESOLVER 67#if DEBUG_RESOLVER
68 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 68 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Received correct hostname `%s'.\n",
69 "Received correct hostname `%s'.\n", hostname); 69 hostname);
70#endif 70#endif
71 (*ok) &= ~4; 71 (*ok) &= ~4;
72 } 72 }
73 else 73 else
74 { 74 {
75#if DEBUG_RESOLVER 75#if DEBUG_RESOLVER
76 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 76 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Received invalid hostname `%s'.\n",
77 "Received invalid hostname `%s'.\n", hostname); 77 hostname);
78#endif 78#endif
79 GNUNET_break (0); 79 GNUNET_break (0);
80 } 80 }
@@ -91,8 +91,8 @@ check_localhost (void *cls, const char *hostname)
91 if (0 == strcmp (hostname, "localhost")) 91 if (0 == strcmp (hostname, "localhost"))
92 { 92 {
93#if DEBUG_RESOLVER 93#if DEBUG_RESOLVER
94 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 94 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Received correct hostname `%s'.\n",
95 "Received correct hostname `%s'.\n", hostname); 95 hostname);
96#endif 96#endif
97 (*ok) &= ~2; 97 (*ok) &= ~2;
98 } 98 }
@@ -139,20 +139,20 @@ check_local_fqdn (void *cls, const char *gnunet_fqdn)
139 139
140 if (0 != gethostname (hostname, sizeof (hostname) - 1)) 140 if (0 != gethostname (hostname, sizeof (hostname) - 1))
141 { 141 {
142 GNUNET_log_strerror (GNUNET_ERROR_TYPE_ERROR | 142 GNUNET_log_strerror (GNUNET_ERROR_TYPE_ERROR | GNUNET_ERROR_TYPE_BULK,
143 GNUNET_ERROR_TYPE_BULK, "gethostname"); 143 "gethostname");
144 return; 144 return;
145 } 145 }
146#if DEBUG_RESOLVER 146#if DEBUG_RESOLVER
147 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 147 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, _("Resolving our FQDN `%s'\n"),
148 _("Resolving our FQDN `%s'\n"), hostname); 148 hostname);
149#endif 149#endif
150 host = gethostbyname (hostname); 150 host = gethostbyname (hostname);
151 if (NULL == host) 151 if (NULL == host)
152 { 152 {
153 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, 153 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
154 _("Could not resolve our FQDN : %s %u\n"), 154 _("Could not resolve our FQDN : %s %u\n"), hstrerror (h_errno),
155 hstrerror (h_errno), h_errno); 155 h_errno);
156 return; 156 return;
157 } 157 }
158 158
@@ -224,8 +224,8 @@ check_rootserver_name (void *cls, const char *hostname)
224} 224}
225 225
226static void 226static void
227run (void *cls, char *const *args, 227run (void *cls, char *const *args, const char *cfgfile,
228 const char *cfgfile, const struct GNUNET_CONFIGURATION_Handle *cfg) 228 const struct GNUNET_CONFIGURATION_Handle *cfg)
229{ 229{
230 int *ok = cls; 230 int *ok = cls;
231 struct sockaddr_in sa; 231 struct sockaddr_in sa;
@@ -283,8 +283,9 @@ run (void *cls, char *const *args,
283 } 283 }
284 284
285 /* Comparing to resolved address to the address the root name server should have */ 285 /* Comparing to resolved address to the address the root name server should have */
286 if (strcmp (inet_ntoa (*(struct in_addr *) rootserver->h_addr_list[0]), 286 if (strcmp
287 ROOTSERVER_IP) != 0) 287 (inet_ntoa (*(struct in_addr *) rootserver->h_addr_list[0]),
288 ROOTSERVER_IP) != 0)
288 { 289 {
289#if DEBUG_RESOLVER 290#if DEBUG_RESOLVER
290 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 291 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
@@ -318,8 +319,8 @@ run (void *cls, char *const *args,
318 GNUNET_break (0); 319 GNUNET_break (0);
319 } 320 }
320 321
321 rootserver 322 rootserver =
322 = gethostbyaddr (&rootserver_addr, sizeof (rootserver_addr), AF_INET); 323 gethostbyaddr (&rootserver_addr, sizeof (rootserver_addr), AF_INET);
323 if (rootserver == NULL) 324 if (rootserver == NULL)
324 { 325 {
325 /* Error: resolving IP addresses does not work */ 326 /* Error: resolving IP addresses does not work */