one char to break it all...
authorMatthias Wachs <wachs@net.in.tum.de>
Thu, 25 Aug 2011 12:20:54 +0000 (12:20 +0000)
committerMatthias Wachs <wachs@net.in.tum.de>
Thu, 25 Aug 2011 12:20:54 +0000 (12:20 +0000)
src/transport/gnunet-service-transport_neighbours.c

index 71539d3de45d241b25608471db6a7091060af5d3..172db755bf349b0d5c376266e7a260d215fc16a8 100644 (file)
@@ -618,7 +618,7 @@ GST_neighbours_test_connected (const struct GNUNET_PeerIdentity *target)
   struct NeighbourMapEntry *n;
 
   n = lookup_neighbour (target);
-  if ((NULL == n) || (n->is_connected == GNUNET_YES))
+  if ((NULL == n) || (n->is_connected != GNUNET_YES))
     return GNUNET_NO;           /* not connected */
   return GNUNET_YES;
 }
@@ -685,6 +685,14 @@ GST_neighbours_send (const struct GNUNET_PeerIdentity *target, const void *msg,
                               gettext_noop
                               ("# SET QUOTA messages ignored (no such peer)"),
                               1, GNUNET_NO);
+#if DEBUG_TRANSPORT
+    if (n == NULL)
+    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+                "Could not send message to peer `%s': unknown neighbor", GNUNET_i2s (target));
+    if (GNUNET_YES != n->is_connected)
+    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+                "Could not send message to peer `%s': not connected\n", GNUNET_i2s (target));
+#endif
     if (NULL != cont)
       cont (cont_cls, GNUNET_SYSERR);
     return;