diff options
Diffstat (limited to 'src/transport/gnunet-communicator-tcp.c')
-rw-r--r-- | src/transport/gnunet-communicator-tcp.c | 32 |
1 files changed, 24 insertions, 8 deletions
diff --git a/src/transport/gnunet-communicator-tcp.c b/src/transport/gnunet-communicator-tcp.c index 1b838bf9c..d8bf7c1a8 100644 --- a/src/transport/gnunet-communicator-tcp.c +++ b/src/transport/gnunet-communicator-tcp.c | |||
@@ -879,12 +879,15 @@ queue_destroy (struct Queue *queue) | |||
879 | struct GNUNET_HashCode h_sock; | 879 | struct GNUNET_HashCode h_sock; |
880 | int sockfd; | 880 | int sockfd; |
881 | 881 | ||
882 | sockfd = GNUNET_NETWORK_get_fd (queue->listen_sock); | 882 | if (NULL != queue->listen_sock) |
883 | GNUNET_CRYPTO_hash (&sockfd, | 883 | { |
884 | sizeof(int), | 884 | sockfd = GNUNET_NETWORK_get_fd (queue->listen_sock); |
885 | &h_sock); | 885 | GNUNET_CRYPTO_hash (&sockfd, |
886 | sizeof(int), | ||
887 | &h_sock); | ||
886 | 888 | ||
887 | lt = GNUNET_CONTAINER_multihashmap_get (lt_map, &h_sock); | 889 | lt = GNUNET_CONTAINER_multihashmap_get (lt_map, &h_sock); |
890 | } | ||
888 | 891 | ||
889 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 892 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
890 | "Disconnecting queue for peer `%s'\n", | 893 | "Disconnecting queue for peer `%s'\n", |
@@ -1900,6 +1903,9 @@ queue_read (void *cls) | |||
1900 | BUF_SIZE - queue->cread_off); | 1903 | BUF_SIZE - queue->cread_off); |
1901 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 1904 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
1902 | "Received %lu bytes from TCP queue\n", rcvd); | 1905 | "Received %lu bytes from TCP queue\n", rcvd); |
1906 | GNUNET_log_from_nocheck (GNUNET_ERROR_TYPE_DEBUG, | ||
1907 | "transport", | ||
1908 | "Received %lu bytes from TCP queue\n", rcvd); | ||
1903 | if (-1 == rcvd) | 1909 | if (-1 == rcvd) |
1904 | { | 1910 | { |
1905 | if ((EAGAIN != errno) && (EINTR != errno)) | 1911 | if ((EAGAIN != errno) && (EINTR != errno)) |
@@ -2675,6 +2681,9 @@ proto_read_kx (void *cls) | |||
2675 | sizeof(pq->ibuf) - pq->ibuf_off); | 2681 | sizeof(pq->ibuf) - pq->ibuf_off); |
2676 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 2682 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
2677 | "Received %lu bytes for KX\n", rcvd); | 2683 | "Received %lu bytes for KX\n", rcvd); |
2684 | GNUNET_log_from_nocheck (GNUNET_ERROR_TYPE_DEBUG, | ||
2685 | "transport", | ||
2686 | "Received %lu bytes for KX\n", rcvd); | ||
2678 | if (-1 == rcvd) | 2687 | if (-1 == rcvd) |
2679 | { | 2688 | { |
2680 | if ((EAGAIN != errno) && (EINTR != errno)) | 2689 | if ((EAGAIN != errno) && (EINTR != errno)) |
@@ -2704,7 +2713,7 @@ proto_read_kx (void *cls) | |||
2704 | { | 2713 | { |
2705 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, | 2714 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, |
2706 | "Invalid TCP KX received from %s\n", | 2715 | "Invalid TCP KX received from %s\n", |
2707 | GNUNET_a2s (queue->address, queue->address_len)); | 2716 | GNUNET_a2s (pq->address, pq->address_len)); |
2708 | gcry_cipher_close (queue->in_cipher); | 2717 | gcry_cipher_close (queue->in_cipher); |
2709 | GNUNET_free (queue); | 2718 | GNUNET_free (queue); |
2710 | free_proto_queue (pq); | 2719 | free_proto_queue (pq); |
@@ -2824,6 +2833,10 @@ queue_read_kx (void *cls) | |||
2824 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 2833 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
2825 | "Received %lu bytes for KX\n", | 2834 | "Received %lu bytes for KX\n", |
2826 | rcvd); | 2835 | rcvd); |
2836 | GNUNET_log_from_nocheck (GNUNET_ERROR_TYPE_DEBUG, | ||
2837 | "transport", | ||
2838 | "Received %lu bytes for KX\n", | ||
2839 | rcvd); | ||
2827 | if (-1 == rcvd) | 2840 | if (-1 == rcvd) |
2828 | { | 2841 | { |
2829 | if ((EAGAIN != errno) && (EINTR != errno)) | 2842 | if ((EAGAIN != errno) && (EINTR != errno)) |
@@ -2918,6 +2931,9 @@ mq_init (void *cls, const struct GNUNET_PeerIdentity *peer, const char *address) | |||
2918 | 2931 | ||
2919 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 2932 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
2920 | "Connecting to %s\n", address); | 2933 | "Connecting to %s\n", address); |
2934 | GNUNET_log_from_nocheck (GNUNET_ERROR_TYPE_DEBUG, | ||
2935 | "transport", | ||
2936 | "Connecting to %s\n", address); | ||
2921 | if (0 != strncmp (address, | 2937 | if (0 != strncmp (address, |
2922 | COMMUNICATOR_ADDRESS_PREFIX "-", | 2938 | COMMUNICATOR_ADDRESS_PREFIX "-", |
2923 | strlen (COMMUNICATOR_ADDRESS_PREFIX "-"))) | 2939 | strlen (COMMUNICATOR_ADDRESS_PREFIX "-"))) |
@@ -3069,9 +3085,9 @@ do_shutdown (void *cls) | |||
3069 | GNUNET_CONTAINER_multihashmap_iterate (lt_map, &get_lt_delete_it, NULL); | 3085 | GNUNET_CONTAINER_multihashmap_iterate (lt_map, &get_lt_delete_it, NULL); |
3070 | GNUNET_CONTAINER_multipeermap_iterate (queue_map, &get_queue_delete_it, NULL); | 3086 | GNUNET_CONTAINER_multipeermap_iterate (queue_map, &get_queue_delete_it, NULL); |
3071 | GNUNET_CONTAINER_multipeermap_destroy (queue_map); | 3087 | GNUNET_CONTAINER_multipeermap_destroy (queue_map); |
3072 | GNUNET_TRANSPORT_communicator_address_remove_all (ch); | ||
3073 | if (NULL != ch) | 3088 | if (NULL != ch) |
3074 | { | 3089 | { |
3090 | GNUNET_TRANSPORT_communicator_address_remove_all (ch); | ||
3075 | GNUNET_TRANSPORT_communicator_disconnect (ch); | 3091 | GNUNET_TRANSPORT_communicator_disconnect (ch); |
3076 | ch = NULL; | 3092 | ch = NULL; |
3077 | } | 3093 | } |
@@ -3238,7 +3254,7 @@ init_socket (struct sockaddr *addr, | |||
3238 | return GNUNET_SYSERR; | 3254 | return GNUNET_SYSERR; |
3239 | } | 3255 | } |
3240 | 3256 | ||
3241 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 3257 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |
3242 | "address %s\n", | 3258 | "address %s\n", |
3243 | GNUNET_a2s (addr, in_len)); | 3259 | GNUNET_a2s (addr, in_len)); |
3244 | 3260 | ||