gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r38185 - gnunet/src/peerinfo-tool


From: gnunet
Subject: [GNUnet-SVN] r38185 - gnunet/src/peerinfo-tool
Date: Sun, 23 Oct 2016 18:03:36 +0200

Author: grothoff
Date: 2016-10-23 18:03:36 +0200 (Sun, 23 Oct 2016)
New Revision: 38185

Modified:
   gnunet/src/peerinfo-tool/gnunet-peerinfo.c
   gnunet/src/peerinfo-tool/test_gnunet_peerinfo.py.in
Log:
avoid use of CLIENT_service_test which is dying

Modified: gnunet/src/peerinfo-tool/gnunet-peerinfo.c
===================================================================
--- gnunet/src/peerinfo-tool/gnunet-peerinfo.c  2016-10-23 16:03:17 UTC (rev 
38184)
+++ gnunet/src/peerinfo-tool/gnunet-peerinfo.c  2016-10-23 16:03:36 UTC (rev 
38185)
@@ -700,24 +700,35 @@
 
 
 /**
- * Function called with the result of the check if the PEERINFO
- * service is running.
+ * Main function that will be run by the scheduler.
  *
- * @param cls closure with our configuration
- * @param result #GNUNET_YES if PEERINFO is running
+ * @param cls closure
+ * @param args remaining command-line arguments
+ * @param cfgfile name of the configuration file used (for saving, can be 
NULL!)
+ * @param c configuration
  */
 static void
-testservice_task (void *cls,
-                  int result)
+run (void *cls,
+     char *const *args,
+     const char *cfgfile,
+     const struct GNUNET_CONFIGURATION_Handle *c)
 {
-  if (GNUNET_YES != result)
+  cfg = c;
+  if ( (NULL != args[0]) &&
+       (NULL == put_uri) &&
+       (args[0] == strcasestr (args[0],
+                              "gnunet://hello/")) )
   {
+    put_uri = GNUNET_strdup (args[0]);
+    args++;
+  }
+  if (NULL != args[0])
+  {
     FPRINTF (stderr,
-             "Service `%s' is not running, please start GNUnet\n",
-             "peerinfo");
+            _("Invalid command line argument `%s'\n"),
+            args[0]);
     return;
   }
-
   if (NULL == (peerinfo = GNUNET_PEERINFO_connect (cfg)))
   {
     FPRINTF (stderr,
@@ -745,45 +756,6 @@
 
 
 /**
- * Main function that will be run by the scheduler.
- *
- * @param cls closure
- * @param args remaining command-line arguments
- * @param cfgfile name of the configuration file used (for saving, can be 
NULL!)
- * @param c configuration
- */
-static void
-run (void *cls,
-     char *const *args,
-     const char *cfgfile,
-     const struct GNUNET_CONFIGURATION_Handle *c)
-{
-  cfg = c;
-  if ( (NULL != args[0]) &&
-       (NULL == put_uri) &&
-       (args[0] == strcasestr (args[0],
-                              "gnunet://hello/")) )
-  {
-    put_uri = GNUNET_strdup (args[0]);
-    args++;
-  }
-  if (NULL != args[0])
-  {
-    FPRINTF (stderr,
-            _("Invalid command line argument `%s'\n"),
-            args[0]);
-    return;
-  }
-
-  GNUNET_CLIENT_service_test ("peerinfo",
-                              cfg,
-                              GNUNET_TIME_UNIT_SECONDS,
-                              &testservice_task,
-                             (void *) cfg);
-}
-
-
-/**
  * Main state machine that goes over all options and
  * runs the next requested function.
  *

Modified: gnunet/src/peerinfo-tool/test_gnunet_peerinfo.py.in
===================================================================
--- gnunet/src/peerinfo-tool/test_gnunet_peerinfo.py.in 2016-10-23 16:03:17 UTC 
(rev 38184)
+++ gnunet/src/peerinfo-tool/test_gnunet_peerinfo.py.in 2016-10-23 16:03:36 UTC 
(rev 38185)
@@ -42,9 +42,6 @@
   gnunettesting = 'gnunet-testing.exe'
 
 pinfo = pexpect ()
-pinfo.spawn (None, [peerinfo, '-i', '-c', 'test_gnunet_peerinfo_data.conf', 
'-L', 'ERROR'], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
-pinfo.expect ("stdout", re.compile (r'Service `peerinfo\' is not running, 
please start GNUnet\r?\n'))
-pinfo.expect ("stdout", "EOF")
 
 
 if os.name == "nt":




reply via email to

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