aboutsummaryrefslogtreecommitdiff
path: root/src/dht
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2014-10-05 12:20:11 +0000
committerChristian Grothoff <christian@grothoff.org>2014-10-05 12:20:11 +0000
commit0a0f5aaf8405113ab3d16fa2fa4abb74ec48225c (patch)
treea8ec67473dbf139a74a2b897abd27cf6cd169ff8 /src/dht
parente8ab9a9eafbe76c19006502a61b0438b6171a7ee (diff)
downloadgnunet-0a0f5aaf8405113ab3d16fa2fa4abb74ec48225c.tar.gz
gnunet-0a0f5aaf8405113ab3d16fa2fa4abb74ec48225c.zip
-actually enable logic to drop part of path to fit message size, check against correct constant
Diffstat (limited to 'src/dht')
-rw-r--r--src/dht/gnunet-service-dht_neighbours.c4
-rw-r--r--src/dht/gnunet-service-xdht_neighbours.c4
2 files changed, 4 insertions, 4 deletions
diff --git a/src/dht/gnunet-service-dht_neighbours.c b/src/dht/gnunet-service-dht_neighbours.c
index 4915302d4..cc1e97bfd 100644
--- a/src/dht/gnunet-service-dht_neighbours.c
+++ b/src/dht/gnunet-service-dht_neighbours.c
@@ -1302,12 +1302,12 @@ GDS_NEIGHBOURS_handle_put (enum GNUNET_BLOCK_Type type,
1302 msize = 1302 msize =
1303 put_path_length * sizeof (struct GNUNET_PeerIdentity) + data_size + 1303 put_path_length * sizeof (struct GNUNET_PeerIdentity) + data_size +
1304 sizeof (struct PeerPutMessage); 1304 sizeof (struct PeerPutMessage);
1305 if (msize >= GNUNET_SERVER_MAX_MESSAGE_SIZE) 1305 if (msize >= GNUNET_CONSTANTS_MAX_ENCRYPTED_MESSAGE_SIZE)
1306 { 1306 {
1307 put_path_length = 0; 1307 put_path_length = 0;
1308 msize = data_size + sizeof (struct PeerPutMessage); 1308 msize = data_size + sizeof (struct PeerPutMessage);
1309 } 1309 }
1310 if (msize >= GNUNET_SERVER_MAX_MESSAGE_SIZE) 1310 if (msize >= GNUNET_CONSTANTS_MAX_ENCRYPTED_MESSAGE_SIZE)
1311 { 1311 {
1312 GNUNET_break (0); 1312 GNUNET_break (0);
1313 GNUNET_free (targets); 1313 GNUNET_free (targets);
diff --git a/src/dht/gnunet-service-xdht_neighbours.c b/src/dht/gnunet-service-xdht_neighbours.c
index 52b410aff..67e6d32c1 100644
--- a/src/dht/gnunet-service-xdht_neighbours.c
+++ b/src/dht/gnunet-service-xdht_neighbours.c
@@ -2469,6 +2469,7 @@ GDS_NEIGHBOURS_handle_get(const struct GNUNET_HashCode *key,
2469 2469
2470/** 2470/**
2471 * Send the get result to requesting client. 2471 * Send the get result to requesting client.
2472 *
2472 * @param key Key of the requested data. 2473 * @param key Key of the requested data.
2473 * @param type Block type 2474 * @param type Block type
2474 * @param target_peer Next peer to forward the message to. 2475 * @param target_peer Next peer to forward the message to.
@@ -2507,8 +2508,7 @@ GDS_NEIGHBOURS_send_get_result (const struct GNUNET_HashCode *key,
2507 if (msize >= GNUNET_CONSTANTS_MAX_ENCRYPTED_MESSAGE_SIZE) 2508 if (msize >= GNUNET_CONSTANTS_MAX_ENCRYPTED_MESSAGE_SIZE)
2508 { 2509 {
2509 put_path_length = 0; 2510 put_path_length = 0;
2510 msize = msize - put_path_length; 2511 msize = msize - put_path_length * sizeof (struct GNUNET_PeerIdentity);
2511 return;
2512 } 2512 }
2513 2513
2514 if (msize >= GNUNET_CONSTANTS_MAX_ENCRYPTED_MESSAGE_SIZE) 2514 if (msize >= GNUNET_CONSTANTS_MAX_ENCRYPTED_MESSAGE_SIZE)