aboutsummaryrefslogtreecommitdiff
path: root/src/dv
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2013-12-10 10:25:14 +0000
committerChristian Grothoff <christian@grothoff.org>2013-12-10 10:25:14 +0000
commit56e65b67304a5aee10b95d8cf03e2d6218cf9b25 (patch)
tree61622342468de958803612eb95a682aba1a5df89 /src/dv
parent19bb57915c215d8b3f2b6641ab31f6c8bcfb6de6 (diff)
downloadgnunet-56e65b67304a5aee10b95d8cf03e2d6218cf9b25.tar.gz
gnunet-56e65b67304a5aee10b95d8cf03e2d6218cf9b25.zip
-fix check, do not drop our own messages, but count foreign drops in stats
Diffstat (limited to 'src/dv')
-rw-r--r--src/dv/gnunet-service-dv.c8
-rw-r--r--src/dv/plugin_transport_dv.c2
2 files changed, 7 insertions, 3 deletions
diff --git a/src/dv/gnunet-service-dv.c b/src/dv/gnunet-service-dv.c
index 706291e2b..42ae9a4d6 100644
--- a/src/dv/gnunet-service-dv.c
+++ b/src/dv/gnunet-service-dv.c
@@ -634,9 +634,9 @@ core_transmit_notify (void *cls, size_t size, void *buf)
634 * Forward the given payload to the given target. 634 * Forward the given payload to the given target.
635 * 635 *
636 * @param target where to send the message 636 * @param target where to send the message
637 * @param distance expected (remaining) distance to the target
637 * @param uid unique ID for the message 638 * @param uid unique ID for the message
638 * @param ultimate_target ultimate recipient for the message 639 * @param ultimate_target ultimate recipient for the message
639 * @param distance expected (remaining) distance to the target
640 * @param sender original sender of the message 640 * @param sender original sender of the message
641 * @param payload payload of the message 641 * @param payload payload of the message
642 */ 642 */
@@ -653,11 +653,15 @@ forward_payload (struct DirectNeighbor *target,
653 size_t msize; 653 size_t msize;
654 654
655 if ( (target->pm_queue_size >= MAX_QUEUE_SIZE) && 655 if ( (target->pm_queue_size >= MAX_QUEUE_SIZE) &&
656 (0 == uid) &&
656 (0 != memcmp (sender, 657 (0 != memcmp (sender,
657 &my_identity, 658 &my_identity,
658 sizeof (struct GNUNET_PeerIdentity))) ) 659 sizeof (struct GNUNET_PeerIdentity))) )
659 { 660 {
660 GNUNET_break (0 == uid); 661 /* not _our_ client and queue is full, drop */
662 GNUNET_STATISTICS_update (stats,
663 "# messages dropped",
664 1, GNUNET_NO);
661 return; 665 return;
662 } 666 }
663 msize = sizeof (struct RouteMessage) + ntohs (payload->size); 667 msize = sizeof (struct RouteMessage) + ntohs (payload->size);
diff --git a/src/dv/plugin_transport_dv.c b/src/dv/plugin_transport_dv.c
index b4de760d2..e90604086 100644
--- a/src/dv/plugin_transport_dv.c
+++ b/src/dv/plugin_transport_dv.c
@@ -301,7 +301,7 @@ handle_dv_connect (void *cls,
301 * If you remove it, also remove libgnunetats linkage from Makefile.am 301 * If you remove it, also remove libgnunetats linkage from Makefile.am
302 */ 302 */
303 LOG (GNUNET_ERROR_TYPE_DEBUG, 303 LOG (GNUNET_ERROR_TYPE_DEBUG,
304 "Received `%s' message for peer `%s' with next hop in network %s \n", 304 "Received `%s' message for peer `%s' with next hop in network %s\n",
305 "DV_CONNECT", 305 "DV_CONNECT",
306 GNUNET_i2s (peer), 306 GNUNET_i2s (peer),
307 GNUNET_ATS_print_network_type (network)); 307 GNUNET_ATS_print_network_type (network));