From: Bart Polot Date: Mon, 15 Dec 2014 07:30:46 +0000 (+0000) Subject: - fix cadet's overhead X-Git-Tag: initial-import-from-subversion-38251~2883 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=13127bcace2ce4ae867f885e7ffb4b3885402ecd;p=oweals%2Fgnunet.git - fix cadet's overhead --- 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.