aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/cadet/gnunet-service-cadet.c10
-rw-r--r--src/cadet/gnunet-service-cadet_channel.c4
-rw-r--r--src/cadet/gnunet-service-cadet_tunnel.c7
-rw-r--r--src/include/gnunet_constants.h14
4 files changed, 23 insertions, 12 deletions
diff --git a/src/cadet/gnunet-service-cadet.c b/src/cadet/gnunet-service-cadet.c
index 7ac4c6370..3f868145e 100644
--- a/src/cadet/gnunet-service-cadet.c
+++ b/src/cadet/gnunet-service-cadet.c
@@ -168,14 +168,18 @@ run (void *cls, struct GNUNET_SERVER_Handle *server,
168int 168int
169main (int argc, char *const *argv) 169main (int argc, char *const *argv)
170{ 170{
171 int ret;
172 int r; 171 int r;
173 172
174 shutting_down = GNUNET_NO; 173 shutting_down = GNUNET_NO;
175 r = GNUNET_SERVICE_run (argc, argv, "cadet", GNUNET_SERVICE_OPTION_NONE, &run, 174 r = GNUNET_SERVICE_run (argc, argv, "cadet", GNUNET_SERVICE_OPTION_NONE, &run,
176 NULL); 175 NULL);
177 GNUNET_free (my_private_key); 176 GNUNET_free (my_private_key);
178 ret = (GNUNET_OK == r) ? 0 : 1;
179 177
180 return ret; 178 if (GNUNET_OK != r)
179 {
180 FPRINTF (stderr, "GNUNET_SERVICE_run for CADET has failed!\n");
181 return 1;
182 }
183
184 return 0;
181} 185}
diff --git a/src/cadet/gnunet-service-cadet_channel.c b/src/cadet/gnunet-service-cadet_channel.c
index 14677c96c..74186310a 100644
--- a/src/cadet/gnunet-service-cadet_channel.c
+++ b/src/cadet/gnunet-service-cadet_channel.c
@@ -737,7 +737,7 @@ channel_retransmit_message (void *cls,
737 copy = rel->head_sent; 737 copy = rel->head_sent;
738 if (NULL == copy) 738 if (NULL == copy)
739 { 739 {
740 GNUNET_break (0); 740 GNUNET_break (0); // FIXME tripped in rps testcase
741 return; 741 return;
742 } 742 }
743 743
@@ -1778,6 +1778,8 @@ GCCH_handle_local_data (struct CadetChannel *ch,
1778/** 1778/**
1779 * Handle a channel destroy requested by a client. 1779 * Handle a channel destroy requested by a client.
1780 * 1780 *
1781 * TODO: add "reason" field
1782 *
1781 * Destroy the channel and the tunnel in case this was the last channel. 1783 * Destroy the channel and the tunnel in case this was the last channel.
1782 * 1784 *
1783 * @param ch Channel. 1785 * @param ch Channel.
diff --git a/src/cadet/gnunet-service-cadet_tunnel.c b/src/cadet/gnunet-service-cadet_tunnel.c
index 9f3156c38..0b314f9a2 100644
--- a/src/cadet/gnunet-service-cadet_tunnel.c
+++ b/src/cadet/gnunet-service-cadet_tunnel.c
@@ -2143,7 +2143,14 @@ void
2143GCT_init (const struct GNUNET_CONFIGURATION_Handle *c, 2143GCT_init (const struct GNUNET_CONFIGURATION_Handle *c,
2144 const struct GNUNET_CRYPTO_EddsaPrivateKey *key) 2144 const struct GNUNET_CRYPTO_EddsaPrivateKey *key)
2145{ 2145{
2146 int expected_overhead;
2147
2146 LOG (GNUNET_ERROR_TYPE_DEBUG, "init\n"); 2148 LOG (GNUNET_ERROR_TYPE_DEBUG, "init\n");
2149
2150 expected_overhead =
2151 sizeof (struct GNUNET_CADET_Encrypted) + sizeof (struct GNUNET_CADET_Data);
2152 GNUNET_assert (GNUNET_CONSTANTS_CADET_P2P_OVERHEAD == expected_overhead);
2153
2147 if (GNUNET_OK != 2154 if (GNUNET_OK !=
2148 GNUNET_CONFIGURATION_get_value_number (c, "CADET", "DEFAULT_TTL", 2155 GNUNET_CONFIGURATION_get_value_number (c, "CADET", "DEFAULT_TTL",
2149 &default_ttl)) 2156 &default_ttl))
diff --git a/src/include/gnunet_constants.h b/src/include/gnunet_constants.h
index 1d2e65581..9ef500388 100644
--- a/src/include/gnunet_constants.h
+++ b/src/include/gnunet_constants.h
@@ -121,18 +121,16 @@ extern "C"
121#define GNUNET_CONSTANTS_MAX_ENCRYPTED_MESSAGE_SIZE (63 * 1024) 121#define GNUNET_CONSTANTS_MAX_ENCRYPTED_MESSAGE_SIZE (63 * 1024)
122 122
123/** 123/**
124 * Size of the CADET message overhead 124 * Size of the CADET message overhead.
125 * - sizeof(GNUNET_CADET_Encrypted) // FIXME use GNUNET_CADET_EncryptedAck when available 125 * See gnunet-service-cadet_tunnel.c: GCT_init for more info.
126 * - sizeof(GNUNET_CADET_Data)
127
128 */ 126 */
129#define GNUNET_CONSTANTS_CADET_P2P_OVERHEAD (sizeof (struct GNUNET_CADET_Encrypted) + sizeof (struct GNUNET_CADET_Data)) 127#define GNUNET_CONSTANTS_CADET_P2P_OVERHEAD 92
130 128
131/** 129/**
132 * Same as core, the conservative value would be: 130 * Maximum message size that can be sent on CADET.
133 * GNUNET_CONSTANTS_MAX_ENCRYPTED_MESSAGE_SIZE - GNUNET_CONSTANTS_CADET_P2P_OVERHEAD
134 */ 131 */
135#define GNUNET_CONSTANTS_MAX_CADET_MESSAGE_SIZE (62 * 1024) 132#define GNUNET_CONSTANTS_MAX_CADET_MESSAGE_SIZE \
133(GNUNET_CONSTANTS_MAX_ENCRYPTED_MESSAGE_SIZE - GNUNET_CONSTANTS_CADET_P2P_OVERHEAD)
136 134
137/** 135/**
138 * Largest block that can be stored in the DHT. 136 * Largest block that can be stored in the DHT.