gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r23497 - in gnunet: . src/dns src/exit src/fs src/include s


From: gnunet
Subject: [GNUnet-SVN] r23497 - in gnunet: . src/dns src/exit src/fs src/include src/testbed src/transport src/util src/vpn
Date: Wed, 29 Aug 2012 15:09:25 +0200

Author: grothoff
Date: 2012-08-29 15:09:25 +0200 (Wed, 29 Aug 2012)
New Revision: 23497

Modified:
   gnunet/configure.ac
   gnunet/src/dns/gnunet-service-dns.c
   gnunet/src/exit/gnunet-daemon-exit.c
   gnunet/src/fs/fs_dirmetascan.c
   gnunet/src/include/gnunet_helper_lib.h
   gnunet/src/testbed/test_gnunet_testbed_helper.c
   gnunet/src/testbed/testbed_api.c
   gnunet/src/transport/plugin_transport_wlan.c
   gnunet/src/transport/test_plugin_transport.c
   gnunet/src/util/common_allocation.c
   gnunet/src/util/helper.c
   gnunet/src/vpn/gnunet-service-vpn.c
Log:
only use control pipe with helpers IF the helper actually supports it

Modified: gnunet/configure.ac
===================================================================
--- gnunet/configure.ac 2012-08-29 12:46:58 UTC (rev 23496)
+++ gnunet/configure.ac 2012-08-29 13:09:25 UTC (rev 23497)
@@ -444,7 +444,7 @@
 AC_CHECK_HEADERS([fcntl.h math.h errno.h ctype.h limits.h stdio.h stdlib.h 
string.h unistd.h stdarg.h signal.h locale.h sys/stat.h 
sys/types.h],,AC_MSG_ERROR([Compiling GNUnet requires standard UNIX headers 
files]))
 
 # Checks for headers that are only required on some systems or opional (and 
where we do NOT abort if they are not there)
-AC_CHECK_HEADERS([langinfo.h sys/param.h sys/mount.h sys/statvfs.h 
sys/select.h sockLib.h sys/mman.h sys/msg.h sys/vfs.h arpa/inet.h fcntl.h 
libintl.h netdb.h netinet/in.h netinet/in_systm.h sys/ioctl.h sys/socket.h 
sys/time.h unistd.h kstat.h sys/sysinfo.h kvm.h sys/file.h sys/resource.h 
ifaddrs.h mach/mach.h stddef.h sys/timeb.h terminos.h argz.h ucred.h endian.h 
sys/endian.h execinfo.h])
+AC_CHECK_HEADERS([malloc.h langinfo.h sys/param.h sys/mount.h sys/statvfs.h 
sys/select.h sockLib.h sys/mman.h sys/msg.h sys/vfs.h arpa/inet.h fcntl.h 
libintl.h netdb.h netinet/in.h netinet/in_systm.h sys/ioctl.h sys/socket.h 
sys/time.h unistd.h kstat.h sys/sysinfo.h kvm.h sys/file.h sys/resource.h 
ifaddrs.h mach/mach.h stddef.h sys/timeb.h terminos.h argz.h ucred.h endian.h 
sys/endian.h execinfo.h])
 
 SAVE_LDFLAGS=$LDFLAGS
 SAVE_CPPFLAGS=$CPPFLAGS
@@ -717,7 +717,7 @@
 AC_HEADER_SYS_WAIT
 AC_TYPE_OFF_T
 AC_TYPE_UID_T
-AC_CHECK_FUNCS([atoll stat64 strnlen mremap setrlimit sysconf initgroups 
strndup gethostbyname2 getpeerucred getpeereid setresuid $funcstocheck 
getifaddrs freeifaddrs getresgid mallinfo])
+AC_CHECK_FUNCS([atoll stat64 strnlen mremap setrlimit sysconf initgroups 
strndup gethostbyname2 getpeerucred getpeereid setresuid $funcstocheck 
getifaddrs freeifaddrs getresgid mallinfo malloc_usable_size])
 
 # restore LIBS
 LIBS=$SAVE_LIBS

Modified: gnunet/src/dns/gnunet-service-dns.c
===================================================================
--- gnunet/src/dns/gnunet-service-dns.c 2012-08-29 12:46:58 UTC (rev 23496)
+++ gnunet/src/dns/gnunet-service-dns.c 2012-08-29 13:09:25 UTC (rev 23497)
@@ -1337,7 +1337,8 @@
                                mesh_handlers,
                                mesh_types);
   }
-  hijacker = GNUNET_HELPER_start ("gnunet-helper-dns",
+  hijacker = GNUNET_HELPER_start (GNUNET_NO,
+                                 "gnunet-helper-dns",
                                  helper_argv,
                                  &process_helper_messages,
                                  NULL, NULL);

Modified: gnunet/src/exit/gnunet-daemon-exit.c
===================================================================
--- gnunet/src/exit/gnunet-daemon-exit.c        2012-08-29 12:46:58 UTC (rev 
23496)
+++ gnunet/src/exit/gnunet-daemon-exit.c        2012-08-29 13:09:25 UTC (rev 
23497)
@@ -3210,7 +3210,8 @@
     GNUNET_SCHEDULER_shutdown ();
     return;
   }
-  helper_handle = GNUNET_HELPER_start ("gnunet-helper-exit", 
+  helper_handle = GNUNET_HELPER_start (GNUNET_NO,
+                                      "gnunet-helper-exit", 
                                       exit_argv,
                                       &message_token,
                                       NULL, NULL);

Modified: gnunet/src/fs/fs_dirmetascan.c
===================================================================
--- gnunet/src/fs/fs_dirmetascan.c      2012-08-29 12:46:58 UTC (rev 23496)
+++ gnunet/src/fs/fs_dirmetascan.c      2012-08-29 13:09:25 UTC (rev 23497)
@@ -454,7 +454,8 @@
   ds->args[1] = ds->filename_expanded;
   ds->args[2] = ds->ex_arg;
   ds->args[3] = NULL;
-  ds->helper = GNUNET_HELPER_start ("gnunet-helper-fs-publish",
+  ds->helper = GNUNET_HELPER_start (GNUNET_NO,
+                                   "gnunet-helper-fs-publish",
                                    ds->args,
                                    &process_helper_msgs,
                                    NULL, ds);

Modified: gnunet/src/include/gnunet_helper_lib.h
===================================================================
--- gnunet/src/include/gnunet_helper_lib.h      2012-08-29 12:46:58 UTC (rev 
23496)
+++ gnunet/src/include/gnunet_helper_lib.h      2012-08-29 13:09:25 UTC (rev 
23497)
@@ -51,6 +51,7 @@
  * restarted when it dies except when it is stopped using GNUNET_HELPER_stop()
  * or when the exp_cb callback is not NULL.
  *
+ * @param with_control_pipe does the helper support the use of a control pipe 
for signalling?
  * @param binary_name name of the binary to run
  * @param binary_argv NULL-terminated list of arguments to give when starting 
the binary (this
  *                    argument must not be modified by the client for
@@ -62,7 +63,8 @@
  * @return the new Handle, NULL on error
  */
 struct GNUNET_HELPER_Handle *
-GNUNET_HELPER_start (const char *binary_name,
+GNUNET_HELPER_start (int with_control_pipe,
+                    const char *binary_name,
                     char *const binary_argv[],
                     GNUNET_SERVER_MessageTokenizerCallback cb,
                     GNUNET_HELPER_ExceptionCallback exp_cb,

Modified: gnunet/src/testbed/test_gnunet_testbed_helper.c
===================================================================
--- gnunet/src/testbed/test_gnunet_testbed_helper.c     2012-08-29 12:46:58 UTC 
(rev 23496)
+++ gnunet/src/testbed/test_gnunet_testbed_helper.c     2012-08-29 13:09:25 UTC 
(rev 23497)
@@ -204,7 +204,8 @@
     };
   const char *controller_name = "127.0.0.1";
 
-  helper = GNUNET_HELPER_start ("gnunet-testbed-helper", 
+  helper = GNUNET_HELPER_start (GNUNET_YES,
+                               "gnunet-testbed-helper", 
                                binary_argv,
                                 &mst_cb, &exp_cb, NULL);
   GNUNET_assert (NULL != helper);

Modified: gnunet/src/testbed/testbed_api.c
===================================================================
--- gnunet/src/testbed/testbed_api.c    2012-08-29 12:46:58 UTC (rev 23496)
+++ gnunet/src/testbed/testbed_api.c    2012-08-29 13:09:25 UTC (rev 23497)
@@ -1054,7 +1054,8 @@
       "gnunet-testbed-helper", NULL
     };
 
-    cp->helper = GNUNET_HELPER_start ("gnunet-testbed-helper", binary_argv, 
+    cp->helper = GNUNET_HELPER_start (GNUNET_YES,
+                                     "gnunet-testbed-helper", binary_argv, 
                                       &helper_mst, &helper_exp_cb, cp);
   }
   else
@@ -1082,7 +1083,8 @@
     remote_args[argp++] = "gnunet-testbed-helper";
     remote_args[argp++] = NULL;
     GNUNET_assert (argp == 8);
-    cp->helper = GNUNET_HELPER_start ("ssh", remote_args,
+    cp->helper = GNUNET_HELPER_start (GNUNET_NO,
+                                     "ssh", remote_args,
                                       &helper_mst, &helper_exp_cb, cp);
   }
   if (NULL == cp->helper)

Modified: gnunet/src/transport/plugin_transport_wlan.c
===================================================================
--- gnunet/src/transport/plugin_transport_wlan.c        2012-08-29 12:46:58 UTC 
(rev 23496)
+++ gnunet/src/transport/plugin_transport_wlan.c        2012-08-29 13:09:25 UTC 
(rev 23497)
@@ -1722,7 +1722,8 @@
     plugin->helper_argv[0] = (char *) "gnunet-helper-transport-wlan";
     plugin->helper_argv[1] = interface;
     plugin->helper_argv[2] = NULL;
-    plugin->suid_helper = GNUNET_HELPER_start ("gnunet-helper-transport-wlan",
+    plugin->suid_helper = GNUNET_HELPER_start (GNUNET_NO,
+                                              "gnunet-helper-transport-wlan",
                                               plugin->helper_argv,
                                               &handle_helper_message,
                                               NULL,
@@ -1732,7 +1733,8 @@
     plugin->helper_argv[0] = (char *) "gnunet-helper-transport-wlan-dummy";
     plugin->helper_argv[1] = (char *) "1";
     plugin->helper_argv[2] = NULL;
-    plugin->suid_helper = GNUNET_HELPER_start 
("gnunet-helper-transport-wlan-dummy",
+    plugin->suid_helper = GNUNET_HELPER_start (GNUNET_NO,
+                                              
"gnunet-helper-transport-wlan-dummy",
                                               plugin->helper_argv,
                                               &handle_helper_message,
                                               NULL,
@@ -1742,7 +1744,8 @@
     plugin->helper_argv[0] = (char *) "gnunet-helper-transport-wlan-dummy";
     plugin->helper_argv[1] = (char *) "2";
     plugin->helper_argv[2] = NULL;
-    plugin->suid_helper = GNUNET_HELPER_start 
("gnunet-helper-transport-wlan-dummy",
+    plugin->suid_helper = GNUNET_HELPER_start (GNUNET_NO,
+                                              
"gnunet-helper-transport-wlan-dummy",
                                               plugin->helper_argv,
                                               &handle_helper_message,
                                               NULL,

Modified: gnunet/src/transport/test_plugin_transport.c
===================================================================
--- gnunet/src/transport/test_plugin_transport.c        2012-08-29 12:46:58 UTC 
(rev 23496)
+++ gnunet/src/transport/test_plugin_transport.c        2012-08-29 13:09:25 UTC 
(rev 23497)
@@ -531,7 +531,8 @@
     helper_argv[0] = (char *) "gnunet-helper-transport-wlan-dummy";
     helper_argv[1] = (char *) "2";
     helper_argv[2] = NULL;
-    suid_helper = GNUNET_HELPER_start ("gnunet-helper-transport-wlan-dummy",
+    suid_helper = GNUNET_HELPER_start (GNUNET_NO,
+                                      "gnunet-helper-transport-wlan-dummy",
                                        helper_argv,
                                        &handle_helper_message,
                                        NULL,

Modified: gnunet/src/util/common_allocation.c
===================================================================
--- gnunet/src/util/common_allocation.c 2012-08-29 12:46:58 UTC (rev 23496)
+++ gnunet/src/util/common_allocation.c 2012-08-29 13:09:25 UTC (rev 23497)
@@ -23,9 +23,11 @@
  * @brief wrapper around malloc/free
  * @author Christian Grothoff
  */
-
 #include "platform.h"
 #include "gnunet_common.h"
+#if HAVE_MALLOC_H
+#include <malloc.h>
+#endif
 
 #define LOG(kind,...) GNUNET_log_from (kind, "util",__VA_ARGS__)
 
@@ -192,11 +194,7 @@
 #if WINDOWS
 #define MSIZE(p) _msize (p)
 #endif
-#if LINUX
-/* FIXME: manpage claims that this function is a GNU extension,
- * but googling shows that it is available on many platforms via
- * inclusion of various headers. For now let's make it Linux-only.
- */
+#if HAVE_MALLOC_USABLE_SIZE
 #define MSIZE(p) malloc_usable_size (p)
 #endif
 

Modified: gnunet/src/util/helper.c
===================================================================
--- gnunet/src/util/helper.c    2012-08-29 12:46:58 UTC (rev 23496)
+++ gnunet/src/util/helper.c    2012-08-29 13:09:25 UTC (rev 23497)
@@ -152,6 +152,12 @@
    * Restart task.
    */
   GNUNET_SCHEDULER_TaskIdentifier restart_task;
+
+  /**
+   * Does the helper support the use of a control pipe for signalling?
+   */
+  int with_control_pipe;
+
 };
 
 
@@ -341,10 +347,10 @@
   h->fh_to_helper =
       GNUNET_DISK_pipe_handle (h->helper_in, GNUNET_DISK_PIPE_END_WRITE);
   h->helper_proc =
-      GNUNET_OS_start_process_vap (GNUNET_YES, GNUNET_OS_INHERIT_STD_ERR, 
-                                  h->helper_in, h->helper_out,
-                                  h->binary_name,
-                                  h->binary_argv);
+    GNUNET_OS_start_process_vap (h->with_control_pipe, 
GNUNET_OS_INHERIT_STD_ERR, 
+                                h->helper_in, h->helper_out,
+                                h->binary_name,
+                                h->binary_argv);
   if (NULL == h->helper_proc)
   {
     /* failed to start process? try again later... */
@@ -385,6 +391,7 @@
  * restarted when it dies except when it is stopped using GNUNET_HELPER_stop()
  * or when the exp_cb callback is not NULL.
  *
+ * @param with_control_pipe does the helper support the use of a control pipe 
for signalling?
  * @param binary_name name of the binary to run
  * @param binary_argv NULL-terminated list of arguments to give when starting 
the binary (this
  *                    argument must not be modified by the client for
@@ -396,7 +403,8 @@
  * @return the new Handle, NULL on error
  */
 struct GNUNET_HELPER_Handle *
-GNUNET_HELPER_start (const char *binary_name,
+GNUNET_HELPER_start (int with_control_pipe,
+                    const char *binary_name,
                     char *const binary_argv[],
                     GNUNET_SERVER_MessageTokenizerCallback cb,
                     GNUNET_HELPER_ExceptionCallback exp_cb,
@@ -405,6 +413,7 @@
   struct GNUNET_HELPER_Handle*h;
 
   h =  GNUNET_malloc (sizeof (struct GNUNET_HELPER_Handle));
+  h->with_control_pipe = with_control_pipe;
   h->binary_name = binary_name;
   h->binary_argv = binary_argv;
   h->cb_cls = cb_cls;

Modified: gnunet/src/vpn/gnunet-service-vpn.c
===================================================================
--- gnunet/src/vpn/gnunet-service-vpn.c 2012-08-29 12:46:58 UTC (rev 23496)
+++ gnunet/src/vpn/gnunet-service-vpn.c 2012-08-29 13:09:25 UTC (rev 23497)
@@ -3180,7 +3180,8 @@
                         &tunnel_cleaner, 
                         mesh_handlers,
                         types);
-  helper_handle = GNUNET_HELPER_start ("gnunet-helper-vpn", vpn_argv,
+  helper_handle = GNUNET_HELPER_start (GNUNET_NO,
+                                      "gnunet-helper-vpn", vpn_argv,
                                       &message_token, NULL, NULL);
   nc = GNUNET_SERVER_notification_context_create (server, 1);
   GNUNET_SERVER_add_handlers (server, service_handlers);




reply via email to

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