aboutsummaryrefslogtreecommitdiff
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
parente8ab9a9eafbe76c19006502a61b0438b6171a7ee (diff)
-actually enable logic to drop part of path to fit message size, check against correct constant
-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 4915302d4e..cc1e97bfdd 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,
msize =
put_path_length * sizeof (struct GNUNET_PeerIdentity) + data_size +
sizeof (struct PeerPutMessage);
- if (msize >= GNUNET_SERVER_MAX_MESSAGE_SIZE)
+ if (msize >= GNUNET_CONSTANTS_MAX_ENCRYPTED_MESSAGE_SIZE)
{
put_path_length = 0;
msize = data_size + sizeof (struct PeerPutMessage);
}
- if (msize >= GNUNET_SERVER_MAX_MESSAGE_SIZE)
+ if (msize >= GNUNET_CONSTANTS_MAX_ENCRYPTED_MESSAGE_SIZE)
{
GNUNET_break (0);
GNUNET_free (targets);
diff --git a/src/dht/gnunet-service-xdht_neighbours.c b/src/dht/gnunet-service-xdht_neighbours.c
index 52b410aff4..67e6d32c1f 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,
/**
* Send the get result to requesting client.
+ *
* @param key Key of the requested data.
* @param type Block type
* @param target_peer Next peer to forward the message to.
@@ -2507,8 +2508,7 @@ GDS_NEIGHBOURS_send_get_result (const struct GNUNET_HashCode *key,
if (msize >= GNUNET_CONSTANTS_MAX_ENCRYPTED_MESSAGE_SIZE)
{
put_path_length = 0;
- msize = msize - put_path_length;
- return;
+ msize = msize - put_path_length * sizeof (struct GNUNET_PeerIdentity);
}
if (msize >= GNUNET_CONSTANTS_MAX_ENCRYPTED_MESSAGE_SIZE)