gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r24201 - gnunet/src/util


From: gnunet
Subject: [GNUnet-SVN] r24201 - gnunet/src/util
Date: Sat, 6 Oct 2012 14:50:14 +0200

Author: grothoff
Date: 2012-10-06 14:50:13 +0200 (Sat, 06 Oct 2012)
New Revision: 24201

Modified:
   gnunet/src/util/client.c
Log:
-highly experimental patch to fix #2578, could theoretically cause unexpected 
problems in unrelated places

Modified: gnunet/src/util/client.c
===================================================================
--- gnunet/src/util/client.c    2012-10-05 17:34:44 UTC (rev 24200)
+++ gnunet/src/util/client.c    2012-10-06 12:50:13 UTC (rev 24201)
@@ -237,6 +237,11 @@
   int in_receive;
 
   /**
+   * Is this the first message we are sending to the service?
+   */
+  int first_message;
+
+  /**
    * How often have we tried to connect?
    */
   unsigned int attempts;
@@ -419,6 +424,7 @@
     return NULL;
   connection = do_connect (service_name, cfg, 0);
   client = GNUNET_malloc (sizeof (struct GNUNET_CLIENT_Connection));
+  client->first_message = GNUNET_YES;
   client->attempts = 1;
   client->connection = connection;
   client->service_name = GNUNET_strdup (service_name);
@@ -941,6 +947,7 @@
   th->reconnect_task = GNUNET_SCHEDULER_NO_TASK;
   th->client->connection =
       do_connect (th->client->service_name, th->client->cfg, 
th->client->attempts++);
+  th->client->first_message = GNUNET_YES;
   if (NULL == th->client->connection)
   {
     /* could happen if we're out of sockets */
@@ -1080,7 +1087,9 @@
   th->client = client;
   th->size = size;
   th->timeout = GNUNET_TIME_relative_to_absolute (timeout);
-  th->auto_retry = auto_retry;
+  /* always auto-retry on first message to service */
+  th->auto_retry = (GNUNET_YES == client->first_message) ? GNUNET_YES : 
auto_retry;
+  client->first_message = GNUNET_NO;
   th->notify = notify;
   th->notify_cls = notify_cls;
   th->attempts_left = MAX_ATTEMPTS;




reply via email to

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