struct GMD_search_handle *h = cls;
struct GNUNET_HELLO_Message *hello;
struct MeshPeerPath *p;
+ struct MeshPeer *peer;
- LOG (GNUNET_ERROR_TYPE_DEBUG, "Got results!\n");
p = path_build_from_dht (get_path, get_path_length,
put_path, put_path_length);
+ peer = GMP_get_short (p->peers[p->length - 1]);
+ LOG (GNUNET_ERROR_TYPE_DEBUG, "Got HELLO for %s\n", GMP_2s (peer));
h->callback (h->cls, p);
path_destroy (p);
- LOG (GNUNET_ERROR_TYPE_ERROR, "Got type %u!\n", type);
- LOG (GNUNET_ERROR_TYPE_ERROR, "Got size %u!\n", size);
hello = (struct GNUNET_HELLO_Message *) data;
- LOG (GNUNET_ERROR_TYPE_ERROR, "HELLO size %u!\n", GNUNET_HELLO_size (hello));
+ GMP_set_hello (peer, hello);
+ GMP_try_connect (peer);
return;
}
announce_id_task = GNUNET_SCHEDULER_NO_TASK;
return;
}
- LOG (GNUNET_ERROR_TYPE_ERROR, "Announce ID\n");
+ LOG (GNUNET_ERROR_TYPE_DEBUG, "Announce ID\n");
/* TODO
* - Set data expiration in function of X
/* Peerinfo gave us no hello yet, try again in a second. */
announce_id_task = GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_SECONDS,
&announce_id, cls);
- LOG (GNUNET_ERROR_TYPE_ERROR, " no hello, waiting!\n");
+ LOG (GNUNET_ERROR_TYPE_DEBUG, " no hello, waiting!\n");
return;
}
- LOG (GNUNET_ERROR_TYPE_ERROR, "Hello %p size: %u\n", hello, size);
+ LOG (GNUNET_ERROR_TYPE_DEBUG, "Hello %p size: %u\n", hello, size);
memset (&phash, 0, sizeof (phash));
memcpy (&phash, &my_full_id, sizeof (my_full_id));
GNUNET_DHT_put (dht_handle, /* DHT handle */
LOG (GNUNET_ERROR_TYPE_DEBUG,
" Starting DHT GET for peer %s\n", GNUNET_i2s (peer_id));
memset (&phash, 0, sizeof (phash));
- memcpy (&phash, &my_full_id, sizeof (my_full_id));
+ memcpy (&phash, peer_id, sizeof (*peer_id));
h = GNUNET_new (struct GMD_search_handle);
h->peer_id = GNUNET_PEER_intern (peer_id);
h->callback = callback;