summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/transport/gnunet-service-transport_neighbours.c10
-rw-r--r--src/transport/gnunet-service-transport_neighbours.h4
-rw-r--r--src/transport/gnunet-service-transport_validation.c17
3 files changed, 25 insertions, 6 deletions
diff --git a/src/transport/gnunet-service-transport_neighbours.c b/src/transport/gnunet-service-transport_neighbours.c
index 53505407e..c92bf3a87 100644
--- a/src/transport/gnunet-service-transport_neighbours.c
+++ b/src/transport/gnunet-service-transport_neighbours.c
@@ -993,6 +993,8 @@ send_with_session (struct NeighbourMapEntry *n,
cont, cont_cls)))) &&
(NULL != cont))
cont (cont_cls, &n->id, GNUNET_SYSERR, msgbuf_size, 0);
+ GST_neighbours_notify_data_sent (&n->id,
+ n->primary_address.address, n->primary_address.session, msgbuf_size);
GNUNET_break (NULL != papi);
}
@@ -1593,6 +1595,8 @@ send_session_connect (struct NeighbourAddress *na)
UINT_MAX,
GNUNET_TIME_UNIT_FOREVER_REL,
NULL, NULL);
+ GST_neighbours_notify_data_sent (&na->address->peer,
+ na->address, na->session, sizeof (struct SessionConnectMessage));
}
@@ -2482,10 +2486,14 @@ GST_neighbours_notify_payload_recv (const struct GNUNET_PeerIdentity *peer,
void
GST_neighbours_notify_data_sent (const struct GNUNET_PeerIdentity *peer,
- size_t size)
+ const struct GNUNET_HELLO_Address *address,
+ struct Session *session,
+ size_t size)
{
struct NeighbourMapEntry *n;
n = lookup_neighbour (peer);
+ if (n->primary_address.session != session)
+ return;
if (NULL == n)
{
return;
diff --git a/src/transport/gnunet-service-transport_neighbours.h b/src/transport/gnunet-service-transport_neighbours.h
index 4875dd6d6..9ba1918c3 100644
--- a/src/transport/gnunet-service-transport_neighbours.h
+++ b/src/transport/gnunet-service-transport_neighbours.h
@@ -222,7 +222,9 @@ GST_neighbours_notify_payload_sent (const struct GNUNET_PeerIdentity *peer,
void
GST_neighbours_notify_data_sent (const struct GNUNET_PeerIdentity *peer,
- size_t size);
+ const struct GNUNET_HELLO_Address *address,
+ struct Session *session,
+ size_t size);
/**
* For an existing neighbour record, set the active connection to
diff --git a/src/transport/gnunet-service-transport_validation.c b/src/transport/gnunet-service-transport_validation.c
index f5f3d6d56..f91ad8ae1 100644
--- a/src/transport/gnunet-service-transport_validation.c
+++ b/src/transport/gnunet-service-transport_validation.c
@@ -28,6 +28,7 @@
#include "gnunet-service-transport_plugins.h"
#include "gnunet-service-transport_hello.h"
#include "gnunet-service-transport_blacklist.h"
+#include "gnunet-service-transport_neighbours.h"
#include "gnunet-service-transport.h"
#include "gnunet_hello_lib.h"
#include "gnunet_ats_service.h"
@@ -552,11 +553,12 @@ transmit_ping_if_allowed (void *cls, const struct GNUNET_PeerIdentity *pid,
network = papi->get_network (ve->address, session);
if (GNUNET_ATS_NET_UNSPECIFIED == network)
{
- GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
- "Could not obtain a valid network for `%s' %s\n",
- GNUNET_i2s (pid), GST_plugins_a2s (ve->address));
- GNUNET_break (0);
+ GNUNET_log(GNUNET_ERROR_TYPE_ERROR,
+ "Could not obtain a valid network for `%s' %s\n",
+ GNUNET_i2s (pid), GST_plugins_a2s (ve->address));
+ GNUNET_break(0);
}
+ GST_neighbours_notify_data_sent (pid, ve->address, session, tsize);
}
else
{
@@ -881,6 +883,9 @@ multicast_pong (void *cls,
(const char *) pong, ntohs (pong->header.size),
PONG_PRIORITY, ACCEPTABLE_PING_DELAY,
NULL, NULL);
+ GST_neighbours_notify_data_sent (&address->peer,
+ address, session, pong->header.size);
+
}
@@ -1102,6 +1107,10 @@ GST_validation_handle_ping (const struct GNUNET_PeerIdentity *sender,
(const char *) pong, ntohs (pong->header.size),
PONG_PRIORITY, ACCEPTABLE_PING_DELAY,
NULL, NULL);
+ if (-1 != ret)
+ GST_neighbours_notify_data_sent (sender,
+ sender_address, session, pong->header.size);
+
}
}
if (ret != -1)