aboutsummaryrefslogtreecommitdiff
path: root/src/util/connection.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2010-05-31 09:47:11 +0000
committerChristian Grothoff <christian@grothoff.org>2010-05-31 09:47:11 +0000
commit1a485a2b3c767e770ee73bf35c00df2f64c36ef0 (patch)
tree3a489fcb8464289490d984900a9bcf9c9e8204d8 /src/util/connection.c
parenta4bdb5d0d57ca2789d31d97a2683c872035738e3 (diff)
downloadgnunet-1a485a2b3c767e770ee73bf35c00df2f64c36ef0.tar.gz
gnunet-1a485a2b3c767e770ee73bf35c00df2f64c36ef0.zip
nicer logging
Diffstat (limited to 'src/util/connection.c')
-rw-r--r--src/util/connection.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/src/util/connection.c b/src/util/connection.c
index 8c7a2c4f8..d84e92d19 100644
--- a/src/util/connection.c
+++ b/src/util/connection.c
@@ -589,11 +589,14 @@ transmit_ready (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc);
589static void 589static void
590connect_fail_continuation (struct GNUNET_CONNECTION_Handle *h) 590connect_fail_continuation (struct GNUNET_CONNECTION_Handle *h)
591{ 591{
592#if DEBUG_CONNECTION 592 GNUNET_log ((0 != strncmp (h->hostname,
593 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 593 "localhost:",
594 "Failed to establish TCP connection to `%s:%u', no further addresses to try (%p).\n", 594 10))
595 h->hostname, h->port, h); 595 ? GNUNET_ERROR_TYPE_INFO
596#endif 596 : GNUNET_ERROR_TYPE_WARNING,
597 _("Failed to establish TCP connection to `%s:%u', no further addresses to try.\n"),
598 h->hostname, h->port);
599 system ("netstat -ntpl");
597 /* connect failed / timed out */ 600 /* connect failed / timed out */
598 GNUNET_break (h->ap_head == NULL); 601 GNUNET_break (h->ap_head == NULL);
599 GNUNET_break (h->ap_tail == NULL); 602 GNUNET_break (h->ap_tail == NULL);
@@ -605,7 +608,7 @@ connect_fail_continuation (struct GNUNET_CONNECTION_Handle *h)
605 { 608 {
606#if DEBUG_CONNECTION 609#if DEBUG_CONNECTION
607 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 610 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
608 "connect_timeout_continuation triggers receive_again (%p)\n", 611 "connect_fail_continuation triggers receive_again (%p)\n",
609 h); 612 h);
610#endif 613#endif
611 h->ccs -= COCO_RECEIVE_AGAIN; 614 h->ccs -= COCO_RECEIVE_AGAIN;
@@ -617,7 +620,7 @@ connect_fail_continuation (struct GNUNET_CONNECTION_Handle *h)
617 { 620 {
618#if DEBUG_CONNECTION 621#if DEBUG_CONNECTION
619 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 622 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
620 "connect_timeout_continuation cancels timeout_task, triggers transmit_ready (%p)\n", 623 "connect_fail_continuation cancels timeout_task, triggers transmit_ready (%p)\n",
621 h); 624 h);
622#endif 625#endif
623 GNUNET_assert (h->nth.timeout_task != GNUNET_SCHEDULER_NO_TASK); 626 GNUNET_assert (h->nth.timeout_task != GNUNET_SCHEDULER_NO_TASK);
@@ -632,7 +635,7 @@ connect_fail_continuation (struct GNUNET_CONNECTION_Handle *h)
632 { 635 {
633#if DEBUG_CONNECTION 636#if DEBUG_CONNECTION
634 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 637 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
635 "connect_timeout_continuation runs destroy_continuation (%p)\n", 638 "connect_fail_continuation runs destroy_continuation (%p)\n",
636 h); 639 h);
637#endif 640#endif
638 h->ccs -= COCO_DESTROY_CONTINUATION; 641 h->ccs -= COCO_DESTROY_CONTINUATION;
@@ -816,11 +819,9 @@ try_connect_using_address (void *cls,
816 GNUNET_free (ap); 819 GNUNET_free (ap);
817 return; /* not supported by OS */ 820 return; /* not supported by OS */
818 } 821 }
819#if DEBUG_CONNECTION
820 GNUNET_log (GNUNET_ERROR_TYPE_INFO, 822 GNUNET_log (GNUNET_ERROR_TYPE_INFO,
821 _("Trying to connect to `%s' (%p)\n"), 823 _("Trying to connect to `%s' (%p)\n"),
822 GNUNET_a2s (ap->addr, ap->addrlen), h); 824 GNUNET_a2s (ap->addr, ap->addrlen), h);
823#endif
824 if ((GNUNET_OK != GNUNET_NETWORK_socket_connect (ap->sock, 825 if ((GNUNET_OK != GNUNET_NETWORK_socket_connect (ap->sock,
825 ap->addr, 826 ap->addr,
826 ap->addrlen)) && 827 ap->addrlen)) &&