aboutsummaryrefslogtreecommitdiff
path: root/examples/c-decrypt/c-decrypt.c
diff options
context:
space:
mode:
Diffstat (limited to 'examples/c-decrypt/c-decrypt.c')
-rw-r--r--examples/c-decrypt/c-decrypt.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/examples/c-decrypt/c-decrypt.c b/examples/c-decrypt/c-decrypt.c
index 2ec27fba1..f03e82295 100644
--- a/examples/c-decrypt/c-decrypt.c
+++ b/examples/c-decrypt/c-decrypt.c
@@ -122,7 +122,7 @@ int udp_server(struct ncrypt * const nc)
if (ret < 0)
{
logger(1, "Crypto error: %d", ret);
- break;
+ continue;
}
msgs_recvd++;
@@ -137,10 +137,12 @@ int udp_server(struct ncrypt * const nc)
HASH_ITER(hh, nc->peers, current_peer, ctmp)
{
printf(
- "*** Peer: %8X | Cryptions: %5zu | Crypto Errors: %2zu | IV Mismatches: %2zu | Send Errors: "
+ "*** Peer: %8X | Key Rotations: %5zu | Cryptions: %5zu | Crypto Errors: %2zu | IV Mismatches: "
+ "%2zu | Send Errors: "
"%2zu | "
"Partial Writes: %2zu ***\n",
current_peer->hash_key,
+ current_peer->key_rotations,
current_peer->cryptions,
current_peer->crypto_errors,
current_peer->iv_mismatches,
@@ -159,12 +161,14 @@ int udp_server(struct ncrypt * const nc)
if (ret != PARSE_OK)
{
logger(1, "JSON parsing failed with: %d", ret);
- break;
+ continue;
}
json_ctx.tokens_found = 0;
}
}
+ ncrypt_free(nc);
+
return 0;
}