gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r37622 - in gnunet/src: multicast social util


From: gnunet
Subject: [GNUnet-SVN] r37622 - in gnunet/src: multicast social util
Date: Sat, 30 Jul 2016 08:22:40 +0200

Author: lynx
Date: 2016-07-30 08:22:40 +0200 (Sat, 30 Jul 2016)
New Revision: 37622

Modified:
   gnunet/src/multicast/gnunet-service-multicast.c
   gnunet/src/multicast/multicast_api.c
   gnunet/src/social/gnunet-social.c
   gnunet/src/util/socks.c
Log:
social: allow multiple calls to disconnect(), rest: handle warnings

Modified: gnunet/src/multicast/gnunet-service-multicast.c
===================================================================
--- gnunet/src/multicast/gnunet-service-multicast.c     2016-07-29 23:01:30 UTC 
(rev 37621)
+++ gnunet/src/multicast/gnunet-service-multicast.c     2016-07-30 06:22:40 UTC 
(rev 37622)
@@ -877,6 +877,7 @@
 }
 
 
+#if 0      // unused as yet
 /**
  * Send message to all connected parents.
  */
@@ -890,6 +891,7 @@
                                                      cadet_send_cb, (void *) 
msg);
   return n;
 }
+#endif
 
 
 /**
@@ -1778,7 +1780,7 @@
                             void **ctx,
                             const struct GNUNET_MessageHeader *m)
 {
-  struct Channel *chn = *ctx;
+  //struct Channel *chn = *ctx;
 
   /* @todo FIXME: got replay error response, send request to other members */
 

Modified: gnunet/src/multicast/multicast_api.c
===================================================================
--- gnunet/src/multicast/multicast_api.c        2016-07-29 23:01:30 UTC (rev 
37621)
+++ gnunet/src/multicast/multicast_api.c        2016-07-30 06:22:40 UTC (rev 
37622)
@@ -400,9 +400,9 @@
   struct GNUNET_MULTICAST_Member *
     mem = GNUNET_CLIENT_MANAGER_get_user_context_ (client, sizeof (*grp));
   grp = &mem->grp;
-  struct MulticastReplayResponseMessage *
-    res = (struct MulticastReplayResponseMessage *) msg;
-
+  // FIXME: Something is missing here for the code to make sense
+  //struct MulticastReplayResponseMessage *
+  //  res = (struct MulticastReplayResponseMessage *) msg;
   if (GNUNET_YES == grp->is_disconnecting)
     return;
 

Modified: gnunet/src/social/gnunet-social.c
===================================================================
--- gnunet/src/social/gnunet-social.c   2016-07-29 23:01:30 UTC (rev 37621)
+++ gnunet/src/social/gnunet-social.c   2016-07-30 06:22:40 UTC (rev 37622)
@@ -131,6 +131,9 @@
 /** exit code */
 static int ret = 1;
 
+/** are we waiting for service to close our connection */
+static char is_disconnecting = 0;
+
 /** Task handle for timeout termination. */
 struct GNUNET_SCHEDULER_Task *timeout_task;
 
@@ -199,8 +202,11 @@
 static void
 disconnect ()
 {
-  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "disconnect()\n");
-  GNUNET_SOCIAL_app_disconnect (app, app_disconnected, NULL);
+  // handle that we get called several times from several places, but should 
we?
+  if (!is_disconnecting++) {
+    GNUNET_SOCIAL_app_disconnect (app, app_disconnected, NULL);
+  }
+  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "disconnect() called for the #%d 
time\n", is_disconnecting);
 }
 
 
@@ -218,7 +224,7 @@
 timeout (void *cls)
 {
   GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "timeout()\n");
-  //disconnect ();
+  disconnect ();
 }
 
 static void
@@ -225,7 +231,7 @@
 schedule_success (void *cls)
 {
   ret = 0;
-  //disconnect ();
+  disconnect ();
 }
 
 
@@ -232,7 +238,7 @@
 static void
 schedule_fail (void *cls)
 {
-  //disconnect ();
+  disconnect ();
 }
 
 

Modified: gnunet/src/util/socks.c
===================================================================
--- gnunet/src/util/socks.c     2016-07-29 23:01:30 UTC (rev 37621)
+++ gnunet/src/util/socks.c     2016-07-30 06:22:40 UTC (rev 37622)
@@ -599,7 +599,7 @@
   if (GNUNET_OK !=
       GNUNET_CONFIGURATION_get_value_string (cfg, service_name, "SOCKSHOST", 
&host0))
     host0 = NULL; /* you don't want to feed a static string to free(), right? 
*/
-  socks5 = GNUNET_CONNECTION_create_from_connect (cfg, host0 || "127.0.0.1", 
port0);
+  socks5 = GNUNET_CONNECTION_create_from_connect (cfg, (char*)(host0 || 
"127.0.0.1"), port0);
   if (host0) GNUNET_free (host0);
 
   /* Sets to NULL if they do not exist */




reply via email to

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