coverity bugfix
authorNathan S. Evans <evans@in.tum.de>
Wed, 3 Feb 2010 12:00:58 +0000 (12:00 +0000)
committerNathan S. Evans <evans@in.tum.de>
Wed, 3 Feb 2010 12:00:58 +0000 (12:00 +0000)
src/transport/gnunet-service-transport.c

index 6fb1f0b38069ae420c52b9aaf2d38a02ab712f71..f43094499bdb3bd015d30e7a526f7386de90cdd8 100644 (file)
@@ -2385,6 +2385,12 @@ static int handle_ping(void *cls, const struct GNUNET_MessageHeader *message,
   if (peer_address == NULL)
     peer_address = add_peer_address(n, sender_address, sender_address_len);
 
+  peer_address->timeout = GNUNET_TIME_relative_to_absolute(GNUNET_CONSTANTS_IDLE_CONNECTION_TIMEOUT);
+
+  /* We don't use the peer_address because the address we received the message from may not
+   * be a reliable way to send it back!  We add it to the list which should queue up a separate
+   * ping to determine if the address is viable.
+   */
   transmit_to_peer(NULL, NULL, TRANSPORT_DEFAULT_PRIORITY, (char *)pong, ntohs(pong->header.size), GNUNET_NO, n);
 
   GNUNET_free(pong);