gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r11439 - gnunet/src/datastore


From: gnunet
Subject: [GNUnet-SVN] r11439 - gnunet/src/datastore
Date: Wed, 19 May 2010 22:20:52 +0200

Author: grothoff
Date: 2010-05-19 22:20:52 +0200 (Wed, 19 May 2010)
New Revision: 11439

Modified:
   gnunet/src/datastore/datastore_api.c
Log:
reduce reconnects

Modified: gnunet/src/datastore/datastore_api.c
===================================================================
--- gnunet/src/datastore/datastore_api.c        2010-05-19 19:52:35 UTC (rev 
11438)
+++ gnunet/src/datastore/datastore_api.c        2010-05-19 20:20:52 UTC (rev 
11439)
@@ -483,6 +483,12 @@
 {
   if (h->client == NULL)
     return;
+#if 0
+  GNUNET_STATISTICS_update (stats,
+                           gettext_noop ("# reconnected to datastore"),
+                           1,
+                           GNUNET_NO);
+#endif
   GNUNET_CLIENT_disconnect (h->client, GNUNET_NO);
   h->client = NULL;
   h->reconnect_task = GNUNET_SCHEDULER_add_delayed (h->sched,
@@ -1019,9 +1025,10 @@
       free_queue_entry (qe);
       if (GNUNET_YES == was_transmitted)       
        do_disconnect (h);
-      rc.iter (rc.iter_cls,
-              NULL, 0, NULL, 0, 0, 0, 
-              GNUNET_TIME_UNIT_ZERO_ABS, 0);   
+      if (rc.iter != NULL)
+       rc.iter (rc.iter_cls,
+                NULL, 0, NULL, 0, 0, 0, 
+                GNUNET_TIME_UNIT_ZERO_ABS, 0); 
       return;
     }
   GNUNET_assert (GNUNET_YES == qe->was_transmitted);
@@ -1034,9 +1041,10 @@
                  "Received end of result set\n");
 #endif
       free_queue_entry (qe);
-      rc.iter (rc.iter_cls,
-              NULL, 0, NULL, 0, 0, 0, 
-              GNUNET_TIME_UNIT_ZERO_ABS, 0);   
+      if (rc.iter != NULL)
+       rc.iter (rc.iter_cls,
+                NULL, 0, NULL, 0, 0, 0, 
+                GNUNET_TIME_UNIT_ZERO_ABS, 0); 
       process_queue (h);
       return;
     }
@@ -1048,11 +1056,18 @@
       free_queue_entry (qe);
       h->retry_time = GNUNET_TIME_UNIT_ZERO;
       do_disconnect (h);
-      rc.iter (rc.iter_cls,
-              NULL, 0, NULL, 0, 0, 0, 
-              GNUNET_TIME_UNIT_ZERO_ABS, 0);   
+      if (rc.iter != NULL)
+       rc.iter (rc.iter_cls,
+                NULL, 0, NULL, 0, 0, 0, 
+                GNUNET_TIME_UNIT_ZERO_ABS, 0); 
       return;
     }
+  if (rc.iter == NULL)
+    {
+      /* abort iteration */
+      do_disconnect (h);
+      return;
+    }
   dm = (const struct DataMessage*) msg;
 #if DEBUG_DATASTORE
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
@@ -1235,7 +1250,15 @@
   int reconnect;
 
   h = qe->h;
-  reconnect = qe->was_transmitted;
+  reconnect = GNUNET_NO;
+  if (GNUNET_YES == qe->was_transmitted) 
+    {
+      if (qe->response_proc == &process_result_message)        
+       qe->qc.rc.iter = NULL;    
+      else
+       reconnect = GNUNET_YES;
+    }
+
   free_queue_entry (qe);
   h->queue_size--;
   if (reconnect)




reply via email to

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