- return GNUNET_OK;
- }
- if (NULL != transport)
- GNUNET_TRANSPORT_offer_hello (transport,
- message,
- NULL,
- NULL);
- return GNUNET_OK;
-}
-
-
-/**
- * Function to fill send buffer with HELLO.
- *
- * @param cls `struct Peer` of the target peer
- * @param size number of bytes available in buf
- * @param buf where the callee should write the message
- * @return number of bytes written to buf
- */
-static size_t
-hello_advertising_ready (void *cls,
- size_t size,
- void *buf)
-{
- struct Peer *pl = cls;
- struct FindAdvHelloContext fah;
- size_t want;
- struct GNUNET_HashCode hc;
-
- pl->hello_req = NULL;
- GNUNET_assert (GNUNET_YES == pl->is_connected);
- /* find applicable HELLOs */
- fah.peer = pl;
- fah.result = NULL;
- fah.max_size = size;
- fah.next_adv = GNUNET_TIME_UNIT_FOREVER_REL;
- GNUNET_CONTAINER_multipeermap_iterate (peers,
- &find_advertisable_hello,
- &fah);
- want = 0;
- if (NULL != fah.result)
- {
- want = GNUNET_HELLO_size (fah.result->hello);
- GNUNET_assert (want <= size);
- memcpy (buf,
- fah.result->hello,
- want);
- GNUNET_CRYPTO_hash (&pl->pid,
- sizeof (struct GNUNET_PeerIdentity),
- &hc);
- GNUNET_CONTAINER_bloomfilter_add (fah.result->filter,
- &hc);
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
- "Sending HELLO with %u bytes",
- (unsigned int) want);
- GNUNET_STATISTICS_update (stats,
- gettext_noop ("# HELLO messages gossipped"), 1,
- GNUNET_NO);