gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r20268 - gnunet/src/namestore


From: gnunet
Subject: [GNUnet-SVN] r20268 - gnunet/src/namestore
Date: Mon, 5 Mar 2012 10:48:41 +0100

Author: wachs
Date: 2012-03-05 10:48:41 +0100 (Mon, 05 Mar 2012)
New Revision: 20268

Modified:
   gnunet/src/namestore/namestore_api.c
Log:
- fix for 2192


Modified: gnunet/src/namestore/namestore_api.c
===================================================================
--- gnunet/src/namestore/namestore_api.c        2012-03-05 09:24:50 UTC (rev 
20267)
+++ gnunet/src/namestore/namestore_api.c        2012-03-05 09:48:41 UTC (rev 
20268)
@@ -834,16 +834,26 @@
   if (h->th != NULL)
   {
     GNUNET_CLIENT_notify_transmit_ready_cancel(h->th);
+    h->th = NULL;
   }
+  if (h->client != NULL)
+  {
+    struct DisconnectContext *d_ctx = GNUNET_malloc (sizeof (struct 
DisconnectContext));
+    d_ctx->h = h;
+    d_ctx->drop = drop;
 
-  struct DisconnectContext *d_ctx = GNUNET_malloc (sizeof (struct 
DisconnectContext));
-  d_ctx->h = h;
-  d_ctx->drop = drop;
-
-  h->th = GNUNET_CLIENT_notify_transmit_ready (h->client, sizeof (struct 
DisconnectMessage),
+    h->th = GNUNET_CLIENT_notify_transmit_ready (h->client, sizeof (struct 
DisconnectMessage),
                                            GNUNET_TIME_UNIT_FOREVER_REL,
                                            GNUNET_NO, 
&transmit_disconnect_to_namestore,
                                            d_ctx);
+  }
+  else
+  {
+    GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "Could not send disconnect 
notification to namestore service, we are not connected!\n");
+    if (GNUNET_YES == drop)
+      GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "NAMESTORE will not drop 
content\n");
+    GNUNET_SCHEDULER_add_now (&clean_up_task, h);
+  }
 }
 
 




reply via email to

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