stuff
[oweals/gnunet.git] / src / transport / gnunet-service-transport.c
index 6fd17e72dd1f56595642d2ac5bc4cbbc096633db..cf02d14b26653156a92bf49dbdefacbef8671eff 100644 (file)
@@ -1446,6 +1446,15 @@ transmit_to_client (struct TransportClient *client,
   struct ClientMessageQueueEntry *q;
   uint16_t msize;
 
+  /* Client==NULL when GNUNET_SERVER_Client disconnected and was
+   * freed in client_disconnect_notification
+   */
+  if (client->client == NULL)
+    {
+      GNUNET_break (0);
+      return;
+    }
+
   if ((client->message_count >= MAX_PENDING) && (GNUNET_YES == may_drop))
     {
       GNUNET_log (GNUNET_ERROR_TYPE_INFO,
@@ -5963,7 +5972,6 @@ handle_peer_address_lookup (void *cls,
 
   uint16_t size;
   struct GNUNET_SERVER_TransmitContext *tc;
-  struct GNUNET_TIME_Absolute timeout;
   struct GNUNET_TIME_Relative rtimeout;
   char *addr_buf;
 
@@ -5976,8 +5984,7 @@ handle_peer_address_lookup (void *cls,
     }
   peer_address_lookup = (const struct PeerAddressLookupMessage *) message;
 
-  timeout = GNUNET_TIME_absolute_ntoh (peer_address_lookup->timeout);
-  rtimeout = GNUNET_TIME_absolute_get_remaining (timeout);
+  rtimeout = GNUNET_TIME_relative_ntoh (peer_address_lookup->timeout);
 
   neighbor_iterator = find_neighbour (&peer_address_lookup->peer);