add option to disable socket forwarding -- useful for debugging
authorChristian Grothoff <christian@grothoff.org>
Fri, 25 Jun 2010 14:00:45 +0000 (14:00 +0000)
committerChristian Grothoff <christian@grothoff.org>
Fri, 25 Jun 2010 14:00:45 +0000 (14:00 +0000)
TODO
contrib/defaults.conf
src/arm/gnunet-service-arm_interceptor.c

diff --git a/TODO b/TODO
index af45fdc0d0bbc4687a0132f4ecd918ef58624492..acac5e4f34f23d7b063495b9b7aa2d1bff06f1bb 100644 (file)
--- a/TODO
+++ b/TODO
@@ -1,10 +1,6 @@
 0.9.0pre1:
 * TRANSPORT:
-  - PING Signing [CG]
   - HTTP backend [MW]
-* ARM:
-  - make listen socket forwarding to child processes on supported platforms
-    optional for debugging [CG/Nate]
 * CORE:
   - derived key generation [Nils]
 * UTIL:
index 449a615627d4074d53190444b806bd395d21ac40..b539295b0919033b49bec414024d0ee27c5d8601 100644 (file)
@@ -57,6 +57,7 @@ BINARY = gnunet-service-statistics
 ACCEPT_FROM = 127.0.0.1;
 ACCEPT_FROM6 = ::1;
 UNIXPATH = /tmp/gnunet-service-statistics.sock
+# DISABLE_SOCKET_FORWARDING = NO
 # USERNAME = 
 # MAXBUF =
 # TIMEOUT =
@@ -76,6 +77,7 @@ BINARY = gnunet-service-resolver
 ACCEPT_FROM = 127.0.0.1;
 ACCEPT_FROM6 = ::1;
 UNIXPATH = /tmp/gnunet-service-resolver.sock
+# DISABLE_SOCKET_FORWARDING = NO
 # USERNAME = 
 # MAXBUF =
 # TIMEOUT =
@@ -95,6 +97,7 @@ BINARY = gnunet-service-peerinfo
 ACCEPT_FROM = 127.0.0.1;
 ACCEPT_FROM6 = ::1;
 UNIXPATH = /tmp/gnunet-service-peerinfo.sock
+# DISABLE_SOCKET_FORWARDING = NO
 # USERNAME = 
 # MAXBUF =
 # TIMEOUT =
@@ -119,6 +122,7 @@ ACCEPT_FROM = 127.0.0.1;
 ACCEPT_FROM6 = ::1;
 PLUGINS = tcp
 UNIXPATH = /tmp/gnunet-service-transport.sock
+# DISABLE_SOCKET_FORWARDING = NO
 # USERNAME = 
 # MAXBUF =
 # TIMEOUT =
@@ -141,6 +145,7 @@ ACCEPT_FROM6 = ::1;
 TOTAL_QUOTA_IN = 65536
 TOTAL_QUOTA_OUT = 65536
 UNIXPATH = /tmp/gnunet-service-core.sock
+# DISABLE_SOCKET_FORWARDING = NO
 # DEBUG = YES
 # USERNAME = 
 # MAXBUF =
@@ -188,6 +193,7 @@ ACCEPT_FROM6 = ::1;
 QUOTA = 100000000
 BLOOMFILTER = $SERVICEHOME/fs/bloomfilter
 DATABASE = sqlite
+# DISABLE_SOCKET_FORWARDING = NO
 
 [datastore-sqlite]
 FILENAME = $SERVICEHOME/datastore/sqlite.db
@@ -206,5 +212,6 @@ ACCEPT_FROM = 127.0.0.1;
 ACCEPT_FROM6 = ::1;
 ACTIVEMIGRATION = YES
 UNIXPATH = /tmp/gnunet-service-fs.sock
+# DISABLE_SOCKET_FORWARDING = NO
 # DEBUG = YES
 
index bc8db396b454d52e09efea533d7f205e4ae2bff5..7c10b94222bede108e72a856de6a33ae7a85cd30 100644 (file)
@@ -858,7 +858,6 @@ static void
 acceptConnection (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc);
 
 
-#if MINGW 
 static void
 accept_and_forward (struct ServiceListeningInfo *serviceListeningInfo)
 {
@@ -909,7 +908,6 @@ accept_and_forward (struct ServiceListeningInfo *serviceListeningInfo)
                                &start_forwarding,
                                fc);
 }
-#endif
 
 
 /**
@@ -927,6 +925,7 @@ acceptConnection (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
   struct ServiceListeningInfo *next;
   int *lsocks;
   unsigned int ls;
+  int use_lsocks;
 
   sli->acceptTask = GNUNET_SCHEDULER_NO_TASK;
   if (0 != (GNUNET_SCHEDULER_REASON_SHUTDOWN & tc->reason))
@@ -935,6 +934,21 @@ acceptConnection (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
                               serviceListeningInfoList_tail, 
                               sli);  
 #ifndef MINGW
+  use_lsocks = GNUNET_YES;
+  if (GNUNET_YES == GNUNET_CONFIGURATION_have_value (cfg,
+                                                    sli->serviceName,
+                                                    "DISABLE_SOCKET_FORWARDING"))
+    use_lsocks = GNUNET_CONFIGURATION_get_value_yesno (cfg,
+                                                      sli->serviceName,
+                                                      "DISABLE_SOCKET_FORWARDING");
+#else
+  use_lsocks = GNUNET_NO;
+#endif
+  if (GNUNET_YES != use_lsocks)
+    {
+      accept_and_forward (sli);
+      return;
+    }
   lsocks = NULL;
   ls = 0;
   next = serviceListeningInfoList_head;
@@ -971,9 +985,6 @@ acceptConnection (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
   GNUNET_array_grow (lsocks, ls, 0);
   GNUNET_free (sli->serviceName);
   GNUNET_free (sli); 
-#else
-  accept_and_forward (sli);  
-#endif
 }