-use is_fwd to retrieve traffic direction
authorBart Polot <bart@net.in.tum.de>
Tue, 20 Sep 2016 01:22:02 +0000 (01:22 +0000)
committerBart Polot <bart@net.in.tum.de>
Tue, 20 Sep 2016 01:22:02 +0000 (01:22 +0000)
src/cadet/gnunet-service-cadet_connection.c

index eb6ba5aa7cc099cead588d35c0404c4850817a9e..5930728a0a298212007c7dff23204f720df3ea1e 100644 (file)
@@ -3067,7 +3067,6 @@ void
 GCC_neighbor_disconnected (struct CadetConnection *c, struct CadetPeer *peer)
 {
   struct CadetFlowControl *fc;
-  struct CadetPeer *hop;
   char peer_name[16];
   int fwd;
 
@@ -3080,14 +3079,12 @@ GCC_neighbor_disconnected (struct CadetConnection *c, struct CadetPeer *peer)
 
   invalidate_paths (c, peer);
 
-  hop = get_prev_hop (c);
-  if (NULL == hop)
+  fwd = is_fwd (c, peer);
+  if (GNUNET_SYSERR == fwd)
   {
-    /* Path was NULL, we should have deleted the connection. */
     GNUNET_break (0);
     return;
   }
-  fwd = (peer == hop);
   if ( (GNUNET_YES == GCC_is_terminal (c, fwd)) ||
        (GNUNET_NO != c->destroy) )
   {