[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnunet] 14/20: -DHT: get tests to pass
From: |
gnunet |
Subject: |
[gnunet] 14/20: -DHT: get tests to pass |
Date: |
Sat, 19 Feb 2022 16:20:54 +0100 |
This is an automated email from the git hooks/post-receive script.
grothoff pushed a commit to branch master
in repository gnunet.
commit e5f00fda52a45ebd22716debf0d9af36fb6fce0a
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Sun Jan 16 20:03:37 2022 +0100
-DHT: get tests to pass
---
src/dht/gnunet-service-dht_neighbours.c | 20 ++++++++++++--------
src/dhtu/plugin_dhtu_gnunet.c | 32 ++++++++++++++++----------------
src/hello/hello-uri.c | 2 ++
3 files changed, 30 insertions(+), 24 deletions(-)
diff --git a/src/dht/gnunet-service-dht_neighbours.c
b/src/dht/gnunet-service-dht_neighbours.c
index fc025fa18..63307dea2 100644
--- a/src/dht/gnunet-service-dht_neighbours.c
+++ b/src/dht/gnunet-service-dht_neighbours.c
@@ -1604,6 +1604,7 @@ GDS_NEIGHBOURS_handle_reply (struct PeerInfo *pi,
prm->header.type = htons (GNUNET_MESSAGE_TYPE_DHT_P2P_RESULT);
prm->header.size = htons (sizeof (buf));
prm->type = htonl (bd->type);
+ prm->reserved = htonl (0);
prm->put_path_length = htonl (ppl);
prm->get_path_length = htonl (get_path_length);
prm->expiration_time = GNUNET_TIME_absolute_hton (bd->expiration_time);
@@ -1668,14 +1669,15 @@ check_dht_p2p_put (void *cls,
/**
* Core handler for p2p put requests.
*
- * @param cls closure with the `struct PeerInfo` of the sender
+ * @param cls closure with the `struct Target` of the sender
* @param message message
*/
static void
handle_dht_p2p_put (void *cls,
const struct PeerPutMessage *put)
{
- struct PeerInfo *peer = cls;
+ struct Target *t = cls;
+ struct PeerInfo *peer = t->pi;
uint16_t msize = ntohs (put->header.size);
enum GNUNET_DHT_RouteOption options
= (enum GNUNET_DHT_RouteOption) ntohl (put->options);
@@ -1982,7 +1984,7 @@ handle_local_result (void *cls,
/**
* Check validity of p2p get request.
*
- * @param cls closure with the `struct PeerInfo` of the sender
+ * @param cls closure with the `struct Target` of the sender
* @param get the message
* @return #GNUNET_OK if the message is well-formed
*/
@@ -2006,14 +2008,15 @@ check_dht_p2p_get (void *cls,
/**
* Core handler for p2p get requests.
*
- * @param cls closure with the `struct PeerInfo` of the sender
+ * @param cls closure with the `struct Target` of the sender
* @param get the message
*/
static void
handle_dht_p2p_get (void *cls,
const struct PeerGetMessage *get)
{
- struct PeerInfo *peer = cls;
+ struct Target *t = cls;
+ struct PeerInfo *peer = t->pi;
uint16_t msize = ntohs (get->header.size);
uint32_t xquery_size = ntohl (get->xquery_size);
uint32_t hop_count = ntohl (get->hop_count);
@@ -2295,7 +2298,8 @@ static void
handle_dht_p2p_result (void *cls,
const struct PeerResultMessage *prm)
{
- struct PeerInfo *peer = cls;
+ struct Target *t = cls;
+ struct PeerInfo *peer = t->pi;
uint16_t msize = ntohs (prm->header.size);
uint32_t get_path_length = ntohl (prm->get_path_length);
struct GDS_DATACACHE_BlockData bd = {
@@ -2433,7 +2437,8 @@ static void
handle_dht_p2p_hello (void *cls,
const struct GNUNET_MessageHeader *hello)
{
- struct PeerInfo *peer = cls;
+ struct Target *t = cls;
+ struct PeerInfo *peer = t->pi;
GNUNET_free (peer->hello);
peer->hello_size = 0;
@@ -2517,7 +2522,6 @@ GDS_NEIGHBOURS_broadcast (const struct
GNUNET_MessageHeader *msg)
if (count >= bucket_size)
break; /* we only consider first #bucket_size entries per bucket */
count++;
- GNUNET_break (0);
do_send (pos,
msg);
}
diff --git a/src/dhtu/plugin_dhtu_gnunet.c b/src/dhtu/plugin_dhtu_gnunet.c
index 493fd5119..fe97f4919 100644
--- a/src/dhtu/plugin_dhtu_gnunet.c
+++ b/src/dhtu/plugin_dhtu_gnunet.c
@@ -234,9 +234,9 @@ hello_offered_cb (void *cls)
* @param address target address to connect to
*/
static void
-ip_try_connect (void *cls,
- const struct GNUNET_PeerIdentity *pid,
- const char *address)
+gnunet_try_connect (void *cls,
+ const struct GNUNET_PeerIdentity *pid,
+ const char *address)
{
struct Plugin *plugin = cls;
struct GNUNET_HELLO_Message *hello = NULL;
@@ -272,8 +272,8 @@ ip_try_connect (void *cls,
* @param target connection to keep alive
*/
static struct GNUNET_DHTU_PreferenceHandle *
-ip_hold (void *cls,
- struct GNUNET_DHTU_Target *target)
+gnunet_hold (void *cls,
+ struct GNUNET_DHTU_Target *target)
{
struct Plugin *plugin = cls;
struct GNUNET_DHTU_PreferenceHandle *ph;
@@ -301,7 +301,7 @@ ip_hold (void *cls,
* @param target connection to keep alive
*/
static void
-ip_drop (struct GNUNET_DHTU_PreferenceHandle *ph)
+gnunet_drop (struct GNUNET_DHTU_PreferenceHandle *ph)
{
struct GNUNET_DHTU_Target *target = ph->target;
struct Plugin *plugin = target->plugin;
@@ -339,12 +339,12 @@ ip_drop (struct GNUNET_DHTU_PreferenceHandle *ph)
* @param finished_cb_cls closure for @a finished_cb
*/
static void
-ip_send (void *cls,
- struct GNUNET_DHTU_Target *target,
- const void *msg,
- size_t msg_size,
- GNUNET_SCHEDULER_TaskCallback finished_cb,
- void *finished_cb_cls)
+gnunet_send (void *cls,
+ struct GNUNET_DHTU_Target *target,
+ const void *msg,
+ size_t msg_size,
+ GNUNET_SCHEDULER_TaskCallback finished_cb,
+ void *finished_cb_cls)
{
struct GNUNET_MQ_Envelope *env;
struct GNUNET_MessageHeader *cmsg;
@@ -607,10 +607,10 @@ libgnunet_plugin_dhtu_gnunet_init (void *cls)
plugin->env = env;
api = GNUNET_new (struct GNUNET_DHTU_PluginFunctions);
api->cls = plugin;
- api->try_connect = &ip_try_connect;
- api->hold = &ip_hold;
- api->drop = &ip_drop;
- api->send = &ip_send;
+ api->try_connect = &gnunet_try_connect;
+ api->hold = &gnunet_hold;
+ api->drop = &gnunet_drop;
+ api->send = &gnunet_send;
plugin->ats = GNUNET_ATS_connectivity_init (env->cfg);
plugin->core = GNUNET_CORE_connect (env->cfg,
plugin,
diff --git a/src/hello/hello-uri.c b/src/hello/hello-uri.c
index 355443455..e57d49e86 100644
--- a/src/hello/hello-uri.c
+++ b/src/hello/hello-uri.c
@@ -813,6 +813,8 @@ GNUNET_HELLO_builder_iterate (const struct
GNUNET_HELLO_Builder *builder,
struct Address *nxt;
*pid = builder->pid;
+ if (NULL == uc)
+ return;
for (struct Address *a = builder->a_head;
NULL != a;
a = nxt)
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
- [gnunet] 16/20: -got basics to work with dhtu and udp+ip underlay, (continued)
- [gnunet] 16/20: -got basics to work with dhtu and udp+ip underlay, gnunet, 2022/02/19
- [gnunet] 18/20: -fix merge issues, gnunet, 2022/02/19
- [gnunet] 20/20: -fix assertion, fix key initialization, gnunet, 2022/02/19
- [gnunet] 17/20: -try to make static analysis happy, gnunet, 2022/02/19
- [gnunet] 15/20: -adding logging, minor dthu bugfixes, gnunet, 2022/02/19
- [gnunet] 19/20: -fix htons/htonl bug introduced by message format change, gnunet, 2022/02/19
- [gnunet] 12/20: -fix crashes on new DHT load/shutdown, gnunet, 2022/02/19
- [gnunet] 10/20: -add hold/drop logic, gnunet, 2022/02/19
- [gnunet] 06/20: -implement TVG, gnunet, 2022/02/19
- [gnunet] 05/20: add new HELLO_URI block support to block plugin, gnunet, 2022/02/19
- [gnunet] 14/20: -DHT: get tests to pass,
gnunet <=