not always ready when send_kx is called
authorChristian Grothoff <christian@grothoff.org>
Fri, 24 Feb 2017 13:16:27 +0000 (14:16 +0100)
committerChristian Grothoff <christian@grothoff.org>
Fri, 24 Feb 2017 13:16:27 +0000 (14:16 +0100)
src/cadet/gnunet-service-cadet-new_tunnels.c

index 9d87f9e030c5a6a2151d8b9b1cbcc8a3c50065ed..bf05fae6ba77ed67bbe6eb4a85a198bb0712448f 100644 (file)
@@ -1319,7 +1319,8 @@ send_kx (struct CadetTunnel *t,
   struct GNUNET_CADET_TunnelKeyExchangeMessage *msg;
   enum GNUNET_CADET_KX_Flags flags;
 
-  if (NULL == ct)
+  if ( (NULL == ct) ||
+       (GNUNET_NO == ct->is_ready) )
     ct = get_ready_connection (t);
   if (NULL == ct)
   {
@@ -1829,7 +1830,7 @@ GCT_handle_kx_auth (struct CadetTConnection *ct,
                               1,
                               GNUNET_NO);
     send_kx (t,
-             NULL,
+             ct,
              &t->ax);
     return;
   }