diff options
author | Christian Grothoff <christian@grothoff.org> | 2017-02-28 14:53:32 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2017-02-28 14:53:42 +0100 |
commit | 7079032ef4d9db825b158e564434205af497f27f (patch) | |
tree | 0b44cae5bd9323a3fc8c65fae5a0ca6d9d93d97d /src/cadet/gnunet-service-cadet-new_tunnels.c | |
parent | e0a04a70bbb2f89a7346e67de026b6c78f22dd7c (diff) | |
download | gnunet-7079032ef4d9db825b158e564434205af497f27f.tar.gz gnunet-7079032ef4d9db825b158e564434205af497f27f.zip |
fix some breaks, add stats for encrypted/decrypted bytes in CADET
Diffstat (limited to 'src/cadet/gnunet-service-cadet-new_tunnels.c')
-rw-r--r-- | src/cadet/gnunet-service-cadet-new_tunnels.c | 12 |
1 files changed, 8 insertions, 4 deletions
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; |