gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r34247 - in gnunet/src: cadet fs include


From: gnunet
Subject: [GNUnet-SVN] r34247 - in gnunet/src: cadet fs include
Date: Sun, 31 Aug 2014 16:58:43 +0200

Author: bratao
Date: 2014-08-31 16:58:43 +0200 (Sun, 31 Aug 2014)
New Revision: 34247

Modified:
   gnunet/src/cadet/cadet_api.c
   gnunet/src/fs/gnunet-service-fs_cadet_client.c
   gnunet/src/include/gnunet_cadet_service.h
Log:
Fix infinite loop ( grothoff, please check !)

Modified: gnunet/src/cadet/cadet_api.c
===================================================================
--- gnunet/src/cadet/cadet_api.c        2014-08-30 08:32:10 UTC (rev 34246)
+++ gnunet/src/cadet/cadet_api.c        2014-08-31 14:58:43 UTC (rev 34247)
@@ -1758,6 +1758,13 @@
 
 
 void
+GNUNET_CADET_cancel_notify (struct GNUNET_CADET_TransmitHandle *th)
+{
+       th->notify = NULL;
+}
+
+
+void
 GNUNET_CADET_notify_transmit_ready_cancel (struct GNUNET_CADET_TransmitHandle 
*th)
 {
   struct GNUNET_CADET_Handle *cadet;

Modified: gnunet/src/fs/gnunet-service-fs_cadet_client.c
===================================================================
--- gnunet/src/fs/gnunet-service-fs_cadet_client.c      2014-08-30 08:32:10 UTC 
(rev 34246)
+++ gnunet/src/fs/gnunet-service-fs_cadet_client.c      2014-08-31 14:58:43 UTC 
(rev 34247)
@@ -219,8 +219,17 @@
              "Resetting cadet channel to %s\n",
              GNUNET_i2s (&mh->target));
   mh->channel = NULL;
+
   if (NULL != channel)
+  {
+    /* Avoid loop */
+    if ( NULL != mh->wh)
+       {
+        GNUNET_CADET_cancel_notify(mh->wh);
+               mh->wh = NULL;
+       }
     GNUNET_CADET_channel_destroy (channel);
+  }
   GNUNET_CONTAINER_multihashmap_iterate (mh->waiting_map,
                                         &move_to_pending,
                                         mh);

Modified: gnunet/src/include/gnunet_cadet_service.h
===================================================================
--- gnunet/src/include/gnunet_cadet_service.h   2014-08-30 08:32:10 UTC (rev 
34246)
+++ gnunet/src/include/gnunet_cadet_service.h   2014-08-31 14:58:43 UTC (rev 
34247)
@@ -348,7 +348,19 @@
 GNUNET_CADET_notify_transmit_ready_cancel (struct GNUNET_CADET_TransmitHandle
                                           *th);
 
+                                                                               
  
+/**
+ * Cancel only the notify without cleaning the structs to a futher call to 
channel destroy
+ *
+ * @param th handle that was returned by "notify_transmit_ready".
+ */
+void
+GNUNET_CADET_cancel_notify (struct GNUNET_CADET_TransmitHandle
+                                          *th);
 
+                                                                               
  
+                                                                               
  
+
 /**
  * Indicate readiness to receive the next message on a channel.
  *




reply via email to

[Prev in Thread] Current Thread [Next in Thread]