removed malloc from curl_logger
[oweals/gnunet.git] / src / transport / gnunet-service-transport.c
index d49c246f0285024e4ff1d2812d9b1100d48b64f5..c117b06daa7b953c6b3aaf36526f062614ad7ecc 100644 (file)
@@ -3288,7 +3288,9 @@ send_periodic_ping (void *cls,
   ping.challenge = htonl(va->challenge);
   memcpy(&ping.target, &neighbour->id, sizeof(struct GNUNET_PeerIdentity));
   if (peer_address->validated != GNUNET_YES)
-    memcpy(message_buf, our_hello, hello_size);
+    {
+      memcpy(message_buf, our_hello, hello_size);
+    }
 
   if (peer_address->addr != NULL)
     {
@@ -3325,7 +3327,12 @@ send_periodic_ping (void *cls,
 #endif
   if (peer_address->validated != GNUNET_YES)
     GNUNET_STATISTICS_update (stats,
-                              gettext_noop ("# PING+HELLO messages sent"),
+                              gettext_noop ("# PING with HELLO messages sent"),
+                              1,
+                              GNUNET_NO);
+  else
+    GNUNET_STATISTICS_update (stats,
+                              gettext_noop ("# PING without HELLO messages sent"),
                               1,
                               GNUNET_NO);
 
@@ -4209,6 +4216,16 @@ process_hello (struct TransportPlugin *plugin,
                                   GNUNET_HELLO_size(hello)));
       chvc = chvc->next;
     }
+
+#if BREAK_TESTS
+  struct NeighbourList *temp_neighbor = find_neighbour(&target);
+  if ((NULL != temp_neighbor))
+    {
+      fprintf(stderr, "Already know peer, ignoring hello\n");
+      return GNUNET_OK;
+    }
+#endif
+
 #if DEBUG_TRANSPORT_HELLO > 2
   if (plugin != NULL)
     {
@@ -4427,8 +4444,14 @@ handle_ping(void *cls, const struct GNUNET_MessageHeader *message,
                    sizeof (struct GNUNET_PeerIdentity)))
     {
       GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
-                  _("Received `%s' message not destined for me!\n"),
-                 "PING");
+                  _("Received `%s' message from `%s' destined for `%s' which is not me!\n"),
+                 "PING",
+                 (sender_address != NULL)
+                 ? a2s (plugin->short_name,
+                        (const struct sockaddr *)sender_address,
+                        sender_address_len)
+                 : "<inbound>",
+                 GNUNET_i2s (&ping->target));
       return GNUNET_SYSERR;
     }
 #if DEBUG_PING_PONG