aboutsummaryrefslogtreecommitdiff
path: root/src/dht/gnunet-service-dht.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2011-09-13 09:54:01 +0000
committerChristian Grothoff <christian@grothoff.org>2011-09-13 09:54:01 +0000
commit683052518084fec9c5117f0efa47693c404372d1 (patch)
tree76b0f30411510b3d5c31aecf58a1cebb075100c3 /src/dht/gnunet-service-dht.c
parent86fb62161c727487a28a303214ec260c64fd9fd5 (diff)
downloadgnunet-683052518084fec9c5117f0efa47693c404372d1.tar.gz
gnunet-683052518084fec9c5117f0efa47693c404372d1.zip
clarifying some FIXMEs
Diffstat (limited to 'src/dht/gnunet-service-dht.c')
-rw-r--r--src/dht/gnunet-service-dht.c21
1 files changed, 10 insertions, 11 deletions
diff --git a/src/dht/gnunet-service-dht.c b/src/dht/gnunet-service-dht.c
index ff8f98a80..42e0c20b8 100644
--- a/src/dht/gnunet-service-dht.c
+++ b/src/dht/gnunet-service-dht.c
@@ -2499,7 +2499,7 @@ handle_dht_get (const struct GNUNET_MessageHeader *msg,
2499 get_msg = (const struct GNUNET_DHT_GetMessage *) msg; 2499 get_msg = (const struct GNUNET_DHT_GetMessage *) msg;
2500 bf_size = ntohs (get_msg->bf_size); 2500 bf_size = ntohs (get_msg->bf_size);
2501 msg_ctx->xquery_size = ntohs (get_msg->xquery_size); 2501 msg_ctx->xquery_size = ntohs (get_msg->xquery_size);
2502 msg_ctx->reply_bf_mutator = get_msg->bf_mutator; /* FIXME: ntohl? */ 2502 msg_ctx->reply_bf_mutator = get_msg->bf_mutator;
2503 if (msize != 2503 if (msize !=
2504 sizeof (struct GNUNET_DHT_GetMessage) + bf_size + msg_ctx->xquery_size) 2504 sizeof (struct GNUNET_DHT_GetMessage) + bf_size + msg_ctx->xquery_size)
2505 { 2505 {
@@ -3786,9 +3786,10 @@ cache_response (struct DHT_MessageContext *msg_ctx)
3786 pos = record->head; 3786 pos = record->head;
3787 while (pos != NULL) 3787 while (pos != NULL)
3788 { 3788 {
3789 if (0 == 3789 if ( (NULL != msg_ctx->peer) &&
3790 memcmp (msg_ctx->peer, &pos->source, 3790 (0 ==
3791 sizeof (struct GNUNET_PeerIdentity))) 3791 memcmp (msg_ctx->peer, &pos->source,
3792 sizeof (struct GNUNET_PeerIdentity))) )
3792 break; /* Already have this peer in reply list! */ 3793 break; /* Already have this peer in reply list! */
3793 pos = pos->next; 3794 pos = pos->next;
3794 } 3795 }
@@ -4784,7 +4785,8 @@ handle_dht_local_route_stop (void *cls, struct GNUNET_SERVER_Client *client,
4784 * @param message message 4785 * @param message message
4785 * @param peer peer identity this notification is about 4786 * @param peer peer identity this notification is about
4786 * @param atsi performance data 4787 * @param atsi performance data
4787 * 4788 * @return GNUNET_OK to keep the connection open,
4789 * GNUNET_SYSERR to close it (signal serious error)
4788 */ 4790 */
4789static int 4791static int
4790handle_dht_p2p_route_request (void *cls, const struct GNUNET_PeerIdentity *peer, 4792handle_dht_p2p_route_request (void *cls, const struct GNUNET_PeerIdentity *peer,
@@ -4805,8 +4807,9 @@ handle_dht_p2p_route_request (void *cls, const struct GNUNET_PeerIdentity *peer,
4805 char *route_path; 4807 char *route_path;
4806 int path_size; 4808 int path_size;
4807 4809
4808 if (ntohs (enc_msg->type) == GNUNET_MESSAGE_TYPE_DHT_P2P_PING) /* Throw these away. FIXME: Don't throw these away? (reply) */ 4810 if (ntohs (enc_msg->type) == GNUNET_MESSAGE_TYPE_DHT_P2P_PING)
4809 { 4811 {
4812 /* Throw these away. FIXME: Don't throw these away? (reply) */
4810#if DEBUG_PING 4813#if DEBUG_PING
4811 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "%s:%s Received P2P Ping message.\n", 4814 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "%s:%s Received P2P Ping message.\n",
4812 my_short_id, "DHT"); 4815 my_short_id, "DHT");
@@ -4869,16 +4872,12 @@ handle_dht_p2p_route_request (void *cls, const struct GNUNET_PeerIdentity *peer,
4869 path_size = 4872 path_size =
4870 ntohl (incoming->outgoing_path_length) * 4873 ntohl (incoming->outgoing_path_length) *
4871 sizeof (struct GNUNET_PeerIdentity); 4874 sizeof (struct GNUNET_PeerIdentity);
4872 /* FIXME bart: assert? remote peer can kill DHT sending malformed packets! */
4873// GNUNET_assert (ntohs (message->size) ==
4874// (sizeof (struct GNUNET_DHT_P2PRouteMessage) +
4875// ntohs (enc_msg->size) + path_size));
4876 if (ntohs (message->size) != 4875 if (ntohs (message->size) !=
4877 (sizeof (struct GNUNET_DHT_P2PRouteMessage) + 4876 (sizeof (struct GNUNET_DHT_P2PRouteMessage) +
4878 ntohs (enc_msg->size) + path_size)) 4877 ntohs (enc_msg->size) + path_size))
4879 { 4878 {
4880 GNUNET_break_op(0); 4879 GNUNET_break_op(0);
4881 return GNUNET_YES; /* FIXME bart GNUNET_NO? */ 4880 return GNUNET_YES;
4882 } 4881 }
4883 route_path = (char *) &incoming[1]; 4882 route_path = (char *) &incoming[1];
4884 route_path = route_path + ntohs (enc_msg->size); 4883 route_path = route_path + ntohs (enc_msg->size);