aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2017-02-28 14:53:32 +0100
committerChristian Grothoff <christian@grothoff.org>2017-02-28 14:53:42 +0100
commit7079032ef4d9db825b158e564434205af497f27f (patch)
tree0b44cae5bd9323a3fc8c65fae5a0ca6d9d93d97d
parente0a04a70bbb2f89a7346e67de026b6c78f22dd7c (diff)
downloadgnunet-7079032ef4d9db825b158e564434205af497f27f.tar.gz
gnunet-7079032ef4d9db825b158e564434205af497f27f.zip
fix some breaks, add stats for encrypted/decrypted bytes in CADET
-rw-r--r--src/cadet/cadet_api_new.c11
-rw-r--r--src/cadet/gnunet-service-cadet-new.c8
-rw-r--r--src/cadet/gnunet-service-cadet-new_tunnels.c12
3 files changed, 19 insertions, 12 deletions
diff --git a/src/cadet/cadet_api_new.c b/src/cadet/cadet_api_new.c
index a62de0a47..efdb6d8a6 100644
--- a/src/cadet/cadet_api_new.c
+++ b/src/cadet/cadet_api_new.c
@@ -626,7 +626,6 @@ handle_channel_created (void *cls,
626 struct GNUNET_CADET_LocalChannelDestroyMessage *d_msg; 626 struct GNUNET_CADET_LocalChannelDestroyMessage *d_msg;
627 struct GNUNET_MQ_Envelope *env; 627 struct GNUNET_MQ_Envelope *env;
628 628
629 GNUNET_break (0);
630 LOG (GNUNET_ERROR_TYPE_DEBUG, 629 LOG (GNUNET_ERROR_TYPE_DEBUG,
631 "No handler for incoming channel %X (on port %s, recently closed?)\n", 630 "No handler for incoming channel %X (on port %s, recently closed?)\n",
632 ntohl (ccn.channel_of_client), 631 ntohl (ccn.channel_of_client),
@@ -682,16 +681,18 @@ handle_channel_destroy (void *cls,
682 struct GNUNET_CADET_Handle *h = cls; 681 struct GNUNET_CADET_Handle *h = cls;
683 struct GNUNET_CADET_Channel *ch; 682 struct GNUNET_CADET_Channel *ch;
684 683
685 LOG (GNUNET_ERROR_TYPE_DEBUG,
686 "Received channel destroy for channel %X from CADET service\n",
687 ntohl (msg->ccn.channel_of_client));
688 ch = find_channel (h, 684 ch = find_channel (h,
689 msg->ccn); 685 msg->ccn);
690 if (NULL == ch) 686 if (NULL == ch)
691 { 687 {
692 GNUNET_break (0); 688 LOG (GNUNET_ERROR_TYPE_DEBUG,
689 "Received channel destroy for unknown channel %X from CADET service\n",
690 ntohl (msg->ccn.channel_of_client));
693 return; 691 return;
694 } 692 }
693 LOG (GNUNET_ERROR_TYPE_DEBUG,
694 "Received channel destroy for channel %X from CADET service\n",
695 ntohl (msg->ccn.channel_of_client));
695 destroy_channel (ch); 696 destroy_channel (ch);
696} 697}
697 698
diff --git a/src/cadet/gnunet-service-cadet-new.c b/src/cadet/gnunet-service-cadet-new.c
index de85db5b6..02126d57d 100644
--- a/src/cadet/gnunet-service-cadet-new.c
+++ b/src/cadet/gnunet-service-cadet-new.c
@@ -760,9 +760,11 @@ handle_local_ack (void *cls,
760 msg->ccn); 760 msg->ccn);
761 if (NULL == ch) 761 if (NULL == ch)
762 { 762 {
763 /* Channel does not exist! */ 763 /* Channel does not exist (anymore) */
764 GNUNET_break (0); 764 LOG (GNUNET_ERROR_TYPE_WARNING,
765 GNUNET_SERVICE_client_drop (c->client); 765 "Ignoring local ACK for channel %u from client (channel unknown, other endpoint may have disconnected)\n",
766 (unsigned int) ntohl (msg->ccn.channel_of_client));
767 GNUNET_SERVICE_client_continue (c->client);
766 return; 768 return;
767 } 769 }
768 LOG (GNUNET_ERROR_TYPE_DEBUG, 770 LOG (GNUNET_ERROR_TYPE_DEBUG,
diff --git a/src/cadet/gnunet-service-cadet-new_tunnels.c b/src/cadet/gnunet-service-cadet-new_tunnels.c
index bf05fae6b..d50860629 100644
--- a/src/cadet/gnunet-service-cadet-new_tunnels.c
+++ b/src/cadet/gnunet-service-cadet-new_tunnels.c
@@ -3082,10 +3082,6 @@ GCT_handle_encrypted (struct CadetTConnection *ct,
3082 break; 3082 break;
3083 } 3083 }
3084 3084
3085 GNUNET_STATISTICS_update (stats,
3086 "# received encrypted",
3087 1,
3088 GNUNET_NO);
3089 decrypted_size = -1; 3085 decrypted_size = -1;
3090 if (CADET_TUNNEL_KEY_OK == t->estate) 3086 if (CADET_TUNNEL_KEY_OK == t->estate)
3091 { 3087 {
@@ -3166,6 +3162,10 @@ GCT_handle_encrypted (struct CadetTConnection *ct,
3166 &t->ax); 3162 &t->ax);
3167 return; 3163 return;
3168 } 3164 }
3165 GNUNET_STATISTICS_update (stats,
3166 "# decrypted bytes",
3167 decrypted_size,
3168 GNUNET_NO);
3169 3169
3170 /* The MST will ultimately call #handle_decrypted() on each message. */ 3170 /* The MST will ultimately call #handle_decrypted() on each message. */
3171 t->current_ct = ct; 3171 t->current_ct = ct;
@@ -3217,6 +3217,10 @@ GCT_send (struct CadetTunnel *t,
3217 &ax_msg[1], 3217 &ax_msg[1],
3218 message, 3218 message,
3219 payload_size); 3219 payload_size);
3220 GNUNET_STATISTICS_update (stats,
3221 "# encrypted bytes",
3222 payload_size,
3223 GNUNET_NO);
3220 ax_msg->ax_header.Ns = htonl (t->ax.Ns++); 3224 ax_msg->ax_header.Ns = htonl (t->ax.Ns++);
3221 ax_msg->ax_header.PNs = htonl (t->ax.PNs); 3225 ax_msg->ax_header.PNs = htonl (t->ax.PNs);
3222 /* FIXME: we should do this once, not once per message; 3226 /* FIXME: we should do this once, not once per message;