const struct GNUNET_HELLO_Message *
GDS_HELLO_get (const struct GNUNET_PeerIdentity *peer)
{
+ if (NULL == peer_to_hello)
+ return NULL;
return GNUNET_CONTAINER_multihashmap_get (peer_to_hello,
&peer->hashPubKey);
}
GNUNET_PEERINFO_notify_cancel (pnc);
pnc = NULL;
}
- GNUNET_CONTAINER_multihashmap_iterate (peer_to_hello,
- &free_hello,
- NULL);
- GNUNET_CONTAINER_multihashmap_destroy (peer_to_hello);
+ if (NULL != peer_to_hello)
+ {
+ GNUNET_CONTAINER_multihashmap_iterate (peer_to_hello,
+ &free_hello,
+ NULL);
+ GNUNET_CONTAINER_multihashmap_destroy (peer_to_hello);
+ }
}
/* end of gnunet-service-dht_hello.c */
if (NULL != GDS_my_hello)
{
GNUNET_BLOCK_mingle_hash (&my_identity.hashPubKey, bf_mutator, &mhash);
- if (GNUNET_YES != GNUNET_CONTAINER_bloomfilter_test (bf, &mhash))
-
+ if ( (NULL == bf) ||
+ (GNUNET_YES != GNUNET_CONTAINER_bloomfilter_test (bf, &mhash)) )
+ {
GDS_NEIGHBOURS_handle_reply (sender,
GNUNET_BLOCK_TYPE_DHT_HELLO,
GNUNET_TIME_relative_to_absolute (GNUNET_CONSTANTS_HELLO_ADDRESS_EXPIRATION),
0, NULL,
GDS_my_hello,
GNUNET_HELLO_size ((const struct GNUNET_HELLO_Message*) GDS_my_hello));
+ }
+ else
+ {
+ GNUNET_STATISTICS_update (GDS_stats,
+ gettext_noop ("# FIND PEER requests ignored due to Bloomfilter"), 1,
+ GNUNET_NO);
+ }
+ }
+ else
+ {
+ GNUNET_STATISTICS_update (GDS_stats,
+ gettext_noop ("# FIND PEER requests ignored due to lack of HELLO"), 1,
+ GNUNET_NO);
}
/* then, also consider sending a random HELLO from the closest bucket */
get->bf_mutator);
}
}
+ else
+ {
+ GNUNET_STATISTICS_update (GDS_stats,
+ gettext_noop ("# P2P GET requests ONLY routed"), 1,
+ GNUNET_NO);
+ }
/* P2P forwarding */
if (eval != GNUNET_BLOCK_EVALUATION_OK_LAST)
#include "gnunet_dht_service.h"
/* DEFINES */
-#define VERBOSE GNUNET_YES
+#define VERBOSE GNUNET_NO
/* Timeout for entire testcase */
#define TIMEOUT GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_MINUTES, 5)