aboutsummaryrefslogtreecommitdiff
path: root/src/transport
diff options
context:
space:
mode:
Diffstat (limited to 'src/transport')
-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,
993 cont, cont_cls)))) && 993 cont, cont_cls)))) &&
994 (NULL != cont)) 994 (NULL != cont))
995 cont (cont_cls, &n->id, GNUNET_SYSERR, msgbuf_size, 0); 995 cont (cont_cls, &n->id, GNUNET_SYSERR, msgbuf_size, 0);
996 GST_neighbours_notify_data_sent (&n->id,
997 n->primary_address.address, n->primary_address.session, msgbuf_size);
996 GNUNET_break (NULL != papi); 998 GNUNET_break (NULL != papi);
997} 999}
998 1000
@@ -1593,6 +1595,8 @@ send_session_connect (struct NeighbourAddress *na)
1593 UINT_MAX, 1595 UINT_MAX,
1594 GNUNET_TIME_UNIT_FOREVER_REL, 1596 GNUNET_TIME_UNIT_FOREVER_REL,
1595 NULL, NULL); 1597 NULL, NULL);
1598 GST_neighbours_notify_data_sent (&na->address->peer,
1599 na->address, na->session, sizeof (struct SessionConnectMessage));
1596 1600
1597} 1601}
1598 1602
@@ -2482,10 +2486,14 @@ GST_neighbours_notify_payload_recv (const struct GNUNET_PeerIdentity *peer,
2482 2486
2483void 2487void
2484GST_neighbours_notify_data_sent (const struct GNUNET_PeerIdentity *peer, 2488GST_neighbours_notify_data_sent (const struct GNUNET_PeerIdentity *peer,
2485 size_t size) 2489 const struct GNUNET_HELLO_Address *address,
2490 struct Session *session,
2491 size_t size)
2486{ 2492{
2487 struct NeighbourMapEntry *n; 2493 struct NeighbourMapEntry *n;
2488 n = lookup_neighbour (peer); 2494 n = lookup_neighbour (peer);
2495 if (n->primary_address.session != session)
2496 return;
2489 if (NULL == n) 2497 if (NULL == n)
2490 { 2498 {
2491 return; 2499 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,
222 222
223void 223void
224GST_neighbours_notify_data_sent (const struct GNUNET_PeerIdentity *peer, 224GST_neighbours_notify_data_sent (const struct GNUNET_PeerIdentity *peer,
225 size_t size); 225 const struct GNUNET_HELLO_Address *address,
226 struct Session *session,
227 size_t size);
226 228
227/** 229/**
228 * For an existing neighbour record, set the active connection to 230 * 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 @@
28#include "gnunet-service-transport_plugins.h" 28#include "gnunet-service-transport_plugins.h"
29#include "gnunet-service-transport_hello.h" 29#include "gnunet-service-transport_hello.h"
30#include "gnunet-service-transport_blacklist.h" 30#include "gnunet-service-transport_blacklist.h"
31#include "gnunet-service-transport_neighbours.h"
31#include "gnunet-service-transport.h" 32#include "gnunet-service-transport.h"
32#include "gnunet_hello_lib.h" 33#include "gnunet_hello_lib.h"
33#include "gnunet_ats_service.h" 34#include "gnunet_ats_service.h"
@@ -552,11 +553,12 @@ transmit_ping_if_allowed (void *cls, const struct GNUNET_PeerIdentity *pid,
552 network = papi->get_network (ve->address, session); 553 network = papi->get_network (ve->address, session);
553 if (GNUNET_ATS_NET_UNSPECIFIED == network) 554 if (GNUNET_ATS_NET_UNSPECIFIED == network)
554 { 555 {
555 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, 556 GNUNET_log(GNUNET_ERROR_TYPE_ERROR,
556 "Could not obtain a valid network for `%s' %s\n", 557 "Could not obtain a valid network for `%s' %s\n",
557 GNUNET_i2s (pid), GST_plugins_a2s (ve->address)); 558 GNUNET_i2s (pid), GST_plugins_a2s (ve->address));
558 GNUNET_break (0); 559 GNUNET_break(0);
559 } 560 }
561 GST_neighbours_notify_data_sent (pid, ve->address, session, tsize);
560 } 562 }
561 else 563 else
562 { 564 {
@@ -881,6 +883,9 @@ multicast_pong (void *cls,
881 (const char *) pong, ntohs (pong->header.size), 883 (const char *) pong, ntohs (pong->header.size),
882 PONG_PRIORITY, ACCEPTABLE_PING_DELAY, 884 PONG_PRIORITY, ACCEPTABLE_PING_DELAY,
883 NULL, NULL); 885 NULL, NULL);
886 GST_neighbours_notify_data_sent (&address->peer,
887 address, session, pong->header.size);
888
884} 889}
885 890
886 891
@@ -1102,6 +1107,10 @@ GST_validation_handle_ping (const struct GNUNET_PeerIdentity *sender,
1102 (const char *) pong, ntohs (pong->header.size), 1107 (const char *) pong, ntohs (pong->header.size),
1103 PONG_PRIORITY, ACCEPTABLE_PING_DELAY, 1108 PONG_PRIORITY, ACCEPTABLE_PING_DELAY,
1104 NULL, NULL); 1109 NULL, NULL);
1110 if (-1 != ret)
1111 GST_neighbours_notify_data_sent (sender,
1112 sender_address, session, pong->header.size);
1113
1105 } 1114 }
1106 } 1115 }
1107 if (ret != -1) 1116 if (ret != -1)