diff options
author | Christian Grothoff <christian@grothoff.org> | 2012-05-06 01:12:57 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2012-05-06 01:12:57 +0000 |
commit | 9fac6b6eefdc9144053f736fd388cb2199a97046 (patch) | |
tree | 82740a981b7f6ae973d915aa77797acd9db668b2 /src/nat/nat_test.c | |
parent | 23d8d343d5c70481ecf78ec4fafc698907f3e8a9 (diff) | |
download | gnunet-9fac6b6eefdc9144053f736fd388cb2199a97046.tar.gz gnunet-9fac6b6eefdc9144053f736fd388cb2199a97046.zip |
-removing legacy ifdefs, fixing log statements
Diffstat (limited to 'src/nat/nat_test.c')
-rw-r--r-- | src/nat/nat_test.c | 14 |
1 files changed, 0 insertions, 14 deletions
diff --git a/src/nat/nat_test.c b/src/nat/nat_test.c index 98ce82e73..5704d3484 100644 --- a/src/nat/nat_test.c +++ b/src/nat/nat_test.c | |||
@@ -180,10 +180,8 @@ reversal_cb (void *cls, const struct sockaddr *addr, socklen_t addrlen) | |||
180 | sa = (const struct sockaddr_in *) addr; | 180 | sa = (const struct sockaddr_in *) addr; |
181 | if (h->data != sa->sin_port) | 181 | if (h->data != sa->sin_port) |
182 | { | 182 | { |
183 | #if DEBUG_NAT | ||
184 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 183 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
185 | "Received connection reversal request for wrong port\n"); | 184 | "Received connection reversal request for wrong port\n"); |
186 | #endif | ||
187 | return; /* wrong port */ | 185 | return; /* wrong port */ |
188 | } | 186 | } |
189 | /* report success */ | 187 | /* report success */ |
@@ -214,17 +212,13 @@ do_udp_read (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
214 | { | 212 | { |
215 | if (data == tst->data) | 213 | if (data == tst->data) |
216 | tst->report (tst->report_cls, GNUNET_OK); | 214 | tst->report (tst->report_cls, GNUNET_OK); |
217 | #if DEBUG_NAT | ||
218 | else | 215 | else |
219 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 216 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
220 | "Received data mismatches expected value\n"); | 217 | "Received data mismatches expected value\n"); |
221 | #endif | ||
222 | } | 218 | } |
223 | #if DEBUG_NAT | ||
224 | else | 219 | else |
225 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 220 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
226 | "Failed to receive data from inbound connection\n"); | 221 | "Failed to receive data from inbound connection\n"); |
227 | #endif | ||
228 | } | 222 | } |
229 | 223 | ||
230 | 224 | ||
@@ -252,17 +246,13 @@ do_read (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
252 | { | 246 | { |
253 | if (data == tst->data) | 247 | if (data == tst->data) |
254 | tst->report (tst->report_cls, GNUNET_OK); | 248 | tst->report (tst->report_cls, GNUNET_OK); |
255 | #if DEBUG_NAT | ||
256 | else | 249 | else |
257 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 250 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
258 | "Received data mismatches expected value\n"); | 251 | "Received data mismatches expected value\n"); |
259 | #endif | ||
260 | } | 252 | } |
261 | #if DEBUG_NAT | ||
262 | else | 253 | else |
263 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 254 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
264 | "Failed to receive data from inbound connection\n"); | 255 | "Failed to receive data from inbound connection\n"); |
265 | #endif | ||
266 | GNUNET_NETWORK_socket_close (na->sock); | 256 | GNUNET_NETWORK_socket_close (na->sock); |
267 | GNUNET_free (na); | 257 | GNUNET_free (na); |
268 | } | 258 | } |
@@ -294,10 +284,8 @@ do_accept (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
294 | GNUNET_log_strerror (GNUNET_ERROR_TYPE_INFO, "accept"); | 284 | GNUNET_log_strerror (GNUNET_ERROR_TYPE_INFO, "accept"); |
295 | return; /* odd error */ | 285 | return; /* odd error */ |
296 | } | 286 | } |
297 | #if DEBUG_NAT | ||
298 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 287 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
299 | "Got an inbound connection, waiting for data\n"); | 288 | "Got an inbound connection, waiting for data\n"); |
300 | #endif | ||
301 | wl = GNUNET_malloc (sizeof (struct NatActivity)); | 289 | wl = GNUNET_malloc (sizeof (struct NatActivity)); |
302 | wl->sock = s; | 290 | wl->sock = s; |
303 | wl->h = tst; | 291 | wl->h = tst; |
@@ -331,10 +319,8 @@ addr_cb (void *cls, int add_remove, const struct sockaddr *addr, | |||
331 | return; | 319 | return; |
332 | if (addrlen != sizeof (struct sockaddr_in)) | 320 | if (addrlen != sizeof (struct sockaddr_in)) |
333 | return; /* ignore IPv6 here */ | 321 | return; /* ignore IPv6 here */ |
334 | #if DEBUG_NAT | ||
335 | LOG (GNUNET_ERROR_TYPE_DEBUG, "Asking gnunet-nat-server to connect to `%s'\n", | 322 | LOG (GNUNET_ERROR_TYPE_DEBUG, "Asking gnunet-nat-server to connect to `%s'\n", |
336 | GNUNET_a2s (addr, addrlen)); | 323 | GNUNET_a2s (addr, addrlen)); |
337 | #endif | ||
338 | sa = (const struct sockaddr_in *) addr; | 324 | sa = (const struct sockaddr_in *) addr; |
339 | msg.header.size = htons (sizeof (struct GNUNET_NAT_TestMessage)); | 325 | msg.header.size = htons (sizeof (struct GNUNET_NAT_TestMessage)); |
340 | msg.header.type = htons (GNUNET_MESSAGE_TYPE_NAT_TEST); | 326 | msg.header.type = htons (GNUNET_MESSAGE_TYPE_NAT_TEST); |