From 13127bcace2ce4ae867f885e7ffb4b3885402ecd Mon Sep 17 00:00:00 2001 From: Bart Polot Date: Mon, 15 Dec 2014 07:30:46 +0000 Subject: [PATCH] - fix cadet's overhead --- src/cadet/gnunet-service-cadet_tunnel.c | 6 ++++-- src/include/gnunet_constants.h | 10 +++++++--- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/cadet/gnunet-service-cadet_tunnel.c b/src/cadet/gnunet-service-cadet_tunnel.c index 7c420843e..f1cbad63c 100644 --- a/src/cadet/gnunet-service-cadet_tunnel.c +++ b/src/cadet/gnunet-service-cadet_tunnel.c @@ -2184,8 +2184,10 @@ GCT_init (const struct GNUNET_CONFIGURATION_Handle *c, LOG (GNUNET_ERROR_TYPE_DEBUG, "init\n"); - expected_overhead = - sizeof (struct GNUNET_CADET_Encrypted) + sizeof (struct GNUNET_CADET_Data); + expected_overhead = 0; + expected_overhead += sizeof (struct GNUNET_CADET_Encrypted); + expected_overhead += sizeof (struct GNUNET_CADET_Data); + expected_overhead += sizeof (struct GNUNET_CADET_ACK); GNUNET_assert (GNUNET_CONSTANTS_CADET_P2P_OVERHEAD == expected_overhead); if (GNUNET_OK != diff --git a/src/include/gnunet_constants.h b/src/include/gnunet_constants.h index 9ef500388..36fa72bd0 100644 --- a/src/include/gnunet_constants.h +++ b/src/include/gnunet_constants.h @@ -121,10 +121,14 @@ extern "C" #define GNUNET_CONSTANTS_MAX_ENCRYPTED_MESSAGE_SIZE (63 * 1024) /** - * Size of the CADET message overhead. - * See gnunet-service-cadet_tunnel.c: GCT_init for more info. + * Size of the CADET message overhead: + * + sizeof (struct GNUNET_CADET_Encrypted) + * + sizeof (struct GNUNET_CADET_Data) + * + sizeof (struct GNUNET_CADET_ACK)) + * + * Checked for correcteness in gnunet-service-cadet_tunnel.c: GCT_init(). */ -#define GNUNET_CONSTANTS_CADET_P2P_OVERHEAD 92 +#define GNUNET_CONSTANTS_CADET_P2P_OVERHEAD 132 /** * Maximum message size that can be sent on CADET. -- 2.25.1