* @param exp when will this value expire
* @param key key of the result
* @param get_path path of the get request
- * @param get_path_length lenght of get_path
+ * @param get_path_length lenght of @a get_path
* @param put_path path of the put request
- * @param put_path_length length of the put_path
+ * @param put_path_length length of the @a put_path
* @param type type of the result
* @param size number of bytes in data
* @param data pointer to the result data
}
s = path_2s (p);
- LOG (GNUNET_ERROR_TYPE_INFO, "Got path from DHT: %s\n", s);
+ LOG (GNUNET_ERROR_TYPE_INFO,
+ "Got path from DHT: %s\n",
+ s);
GNUNET_free_non_null (s);
peer = GCP_get_short (p->peers[p->length - 1], GNUNET_YES);
- LOG (GNUNET_ERROR_TYPE_DEBUG, "Got HELLO for %s\n", GCP_2s (peer));
+ LOG (GNUNET_ERROR_TYPE_DEBUG,
+ "Got HELLO for %s\n",
+ GCP_2s (peer));
h->callback (h->cls, p);
path_destroy (p);
hello = (struct GNUNET_HELLO_Message *) data;
* Hello message.
*/
struct GNUNET_HELLO_Message* hello;
+
+ /**
+ * Handle to us offering the HELLO to the transport.
+ */
+ struct GNUNET_TRANSPORT_OfferHelloHandle *hello_offer;
};
while (NULL != p)
{
nextp = p->next;
- GNUNET_CONTAINER_DLL_remove (peer->path_head, peer->path_tail, p);
+ GNUNET_CONTAINER_DLL_remove (peer->path_head,
+ peer->path_tail,
+ p);
path_destroy (p);
p = nextp;
}
}
if (NULL != peer->core_transmit)
GNUNET_CORE_notify_transmit_ready_cancel (peer->core_transmit);
+ if (NULL != peer->hello_offer)
+ {
+ GNUNET_TRANSPORT_offer_hello_cancel (peer->hello_offer);
+ peer->hello_offer = NULL;
+ }
GNUNET_free_non_null (peer->hello);
GNUNET_free (peer);
return GNUNET_OK;
* @param tc TaskContext.
*/
static void
-try_connect (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
+try_connect (void *cls,
+ const struct GNUNET_SCHEDULER_TaskContext *tc)
{
struct CadetPeer *peer = cls;
+ peer->hello_offer = NULL;
if (0 != (GNUNET_SCHEDULER_REASON_SHUTDOWN & tc->reason))
return;
int rerun_search;
GCC_check_connections ();
- LOG (GNUNET_ERROR_TYPE_DEBUG, "peer_connect towards %s\n", GCP_2s (peer));
-
+ LOG (GNUNET_ERROR_TYPE_DEBUG,
+ "peer_connect towards %s\n",
+ GCP_2s (peer));
/* If we have a current hello, try to connect using it. */
GCP_try_connect (peer);
return;
mh = GNUNET_HELLO_get_header (hello);
- GNUNET_TRANSPORT_offer_hello (transport_handle,
- mh,
- &try_connect,
- peer);
+ peer->hello_offer = GNUNET_TRANSPORT_offer_hello (transport_handle,
+ mh,
+ &try_connect,
+ peer);
GCC_check_connections ();
}