doxygen
[oweals/gnunet.git] / src / transport / gnunet-service-transport.c
index e1f6793b23f5cb20515e8776d4b240041a7a7981..1a22e64f5912cc4de85a5e567f6820f694c2e912 100644 (file)
@@ -1406,7 +1406,7 @@ transmit_send_ok (struct TransportClient *client,
  *
  * @param cls closure, identifies the entry on the
  *            message queue that was transmitted and the
- *            client responsible for queueing the message
+ *            client responsible for queuing the message
  * @param target the peer receiving the message
  * @param result GNUNET_OK on success, if the transmission
  *           failed, we should not tell the client to transmit
@@ -4516,9 +4516,10 @@ handle_ping(void *cls, const struct GNUNET_MessageHeader *message,
       memcpy (&pong[1],
              plugin->short_name,
              slen);
-      memcpy (&((char*)&pong[1])[slen],
-             sender_address,
-             sender_address_len);
+      if ((sender_address!=NULL) && (sender_address_len > 0))
+                 memcpy (&((char*)&pong[1])[slen],
+                         sender_address,
+                         sender_address_len);
       if (GNUNET_TIME_absolute_get_remaining (session_header->pong_sig_expires).rel_value < PONG_SIGNATURE_LIFETIME.rel_value / 4)
        {
          /* create / update cached sig */
@@ -4693,7 +4694,8 @@ handle_ping(void *cls, const struct GNUNET_MessageHeader *message,
  * @param peer (claimed) identity of the other peer
  * @param message the message, NULL if we only care about
  *                learning about the delay until we should receive again
- * @param distance in overlay hops; use 1 unless DV (or 0 if message == NULL)
+ * @param ats information for automatic transport selection
+ * @param ats_count number of elements in ats not including 0-terminator
  * @param session identifier used for this session (can be NULL)
  * @param sender_address binary address of the sender (if observed)
  * @param sender_address_len number of bytes in sender_address
@@ -4899,7 +4901,6 @@ handle_start (void *cls,
          GNUNET_break(0);
       }
       cim = GNUNET_malloc (size);
-
       cim->header.size = htons (size);
       cim->header.type = htons (GNUNET_MESSAGE_TYPE_TRANSPORT_CONNECT);
       cim->ats_count = htonl(ats_count);
@@ -4919,9 +4920,9 @@ handle_start (void *cls,
                  }
            n = n->next;
       }
+      GNUNET_free (cim);
   }
   GNUNET_SERVER_receive_done (client, GNUNET_OK);
-  GNUNET_free(cim);
 }