gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r9332 - in gnunet: . src src/arm src/fs src/include src/tes


From: gnunet
Subject: [GNUnet-SVN] r9332 - in gnunet: . src src/arm src/fs src/include src/testing src/transport src/util
Date: Wed, 28 Oct 2009 13:52:26 -0600

Author: grothoff
Date: 2009-10-28 13:52:25 -0600 (Wed, 28 Oct 2009)
New Revision: 9332

Added:
   gnunet/src/fs/test_fs_namespace_data.conf
Modified:
   gnunet/INSTALL
   gnunet/TODO
   gnunet/src/Makefile.am
   gnunet/src/arm/arm_api.c
   gnunet/src/arm/gnunet-service-arm.c
   gnunet/src/include/gnunet_client_lib.h
   gnunet/src/testing/test_testing.c
   gnunet/src/testing/test_testing_data.conf
   gnunet/src/testing/testing.c
   gnunet/src/transport/gnunet-service-transport.c
   gnunet/src/transport/plugin_transport_tcp.c
   gnunet/src/util/client.c
   gnunet/src/util/test_service.c
Log:
getting testing to work

Modified: gnunet/INSTALL
===================================================================
--- gnunet/INSTALL      2009-10-28 19:47:12 UTC (rev 9331)
+++ gnunet/INSTALL      2009-10-28 19:52:25 UTC (rev 9332)
@@ -2,15 +2,15 @@
 *************************
 
 Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005,
-2006, 2007 Free Software Foundation, Inc.
+2006, 2007, 2008, 2009 Free Software Foundation, Inc.
 
-This file is free documentation; the Free Software Foundation gives
+   This file is free documentation; the Free Software Foundation gives
 unlimited permission to copy, distribute and modify it.
 
 Basic Installation
 ==================
 
-Briefly, the shell commands `./configure; make; make install' should
+   Briefly, the shell commands `./configure; make; make install' should
 configure, build, and install this package.  The following
 more-detailed instructions are generic; see the `README' file for
 instructions specific to this package.
@@ -73,9 +73,9 @@
 Compilers and Options
 =====================
 
-Some systems require unusual options for compilation or linking that the
-`configure' script does not know about.  Run `./configure --help' for
-details on some of the pertinent environment variables.
+   Some systems require unusual options for compilation or linking that
+the `configure' script does not know about.  Run `./configure --help'
+for details on some of the pertinent environment variables.
 
    You can give `configure' initial values for configuration parameters
 by setting variables in the command line or in the environment.  Here
@@ -88,7 +88,7 @@
 Compiling For Multiple Architectures
 ====================================
 
-You can compile the package for more than one kind of computer at the
+   You can compile the package for more than one kind of computer at the
 same time, by placing the object files for each architecture in their
 own directory.  To do this, you can use GNU `make'.  `cd' to the
 directory where you want the object files and executables to go and run
@@ -100,10 +100,24 @@
 installed the package for one architecture, use `make distclean' before
 reconfiguring for another architecture.
 
+   On MacOS X 10.5 and later systems, you can create libraries and
+executables that work on multiple system types--known as "fat" or
+"universal" binaries--by specifying multiple `-arch' options to the
+compiler but only a single `-arch' option to the preprocessor.  Like
+this:
+
+     ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
+                 CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
+                 CPP="gcc -E" CXXCPP="g++ -E"
+
+   This is not guaranteed to produce working output in all cases, you
+may have to build one architecture at a time and combine the results
+using the `lipo' tool if you have problems.
+
 Installation Names
 ==================
 
-By default, `make install' installs the package's commands under
+   By default, `make install' installs the package's commands under
 `/usr/local/bin', include files under `/usr/local/include', etc.  You
 can specify an installation prefix other than `/usr/local' by giving
 `configure' the option `--prefix=PREFIX'.
@@ -126,7 +140,7 @@
 Optional Features
 =================
 
-Some packages pay attention to `--enable-FEATURE' options to
+   Some packages pay attention to `--enable-FEATURE' options to
 `configure', where FEATURE indicates an optional part of the package.
 They may also pay attention to `--with-PACKAGE' options, where PACKAGE
 is something like `gnu-as' or `x' (for the X Window System).  The
@@ -138,14 +152,46 @@
 you can use the `configure' options `--x-includes=DIR' and
 `--x-libraries=DIR' to specify their locations.
 
+Particular systems
+==================
+
+   On HP-UX, the default C compiler is not ANSI C compatible.  If GNU
+CC is not installed, it is recommended to use the following options in
+order to use an ANSI C compiler:
+
+     ./configure CC="cc -Ae -D_XOPEN_SOURCE=500"
+
+and if that doesn't work, install pre-built binaries of GCC for HP-UX.
+
+   On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot
+parse its `<wchar.h>' header file.  The option `-nodtk' can be used as
+a workaround.  If GNU CC is not installed, it is therefore recommended
+to try
+
+     ./configure CC="cc"
+
+and if that doesn't work, try
+
+     ./configure CC="cc -nodtk"
+
+   On Solaris, don't put `/usr/ucb' early in your `PATH'.  This
+directory contains several dysfunctional programs; working variants of
+these programs are available in `/usr/bin'.  So, if you need `/usr/ucb'
+in your `PATH', put it _after_ `/usr/bin'.
+
+   On Haiku, software installed for all users goes in `/boot/common',
+not `/usr/local'.  It is recommended to use the following options:
+
+     ./configure --prefix=/boot/common
+
 Specifying the System Type
 ==========================
 
-There may be some features `configure' cannot figure out automatically,
-but needs to determine by the type of machine the package will run on.
-Usually, assuming the package is built to be run on the _same_
-architectures, `configure' can figure that out, but if it prints a
-message saying it cannot guess the machine type, give it the
+   There may be some features `configure' cannot figure out
+automatically, but needs to determine by the type of machine the package
+will run on.  Usually, assuming the package is built to be run on the
+_same_ architectures, `configure' can figure that out, but if it prints
+a message saying it cannot guess the machine type, give it the
 `--build=TYPE' option.  TYPE can either be a short name for the system
 type, such as `sun4', or a canonical name which has the form:
 
@@ -153,7 +199,8 @@
 
 where SYSTEM can have one of these forms:
 
-     OS KERNEL-OS
+     OS
+     KERNEL-OS
 
    See the file `config.sub' for the possible values of each field.  If
 `config.sub' isn't included in this package, then this package doesn't
@@ -171,9 +218,9 @@
 Sharing Defaults
 ================
 
-If you want to set default values for `configure' scripts to share, you
-can create a site shell script called `config.site' that gives default
-values for variables like `CC', `cache_file', and `prefix'.
+   If you want to set default values for `configure' scripts to share,
+you can create a site shell script called `config.site' that gives
+default values for variables like `CC', `cache_file', and `prefix'.
 `configure' looks for `PREFIX/share/config.site' if it exists, then
 `PREFIX/etc/config.site' if it exists.  Or, you can set the
 `CONFIG_SITE' environment variable to the location of the site script.
@@ -182,7 +229,7 @@
 Defining Variables
 ==================
 
-Variables not defined in a site shell script can be set in the
+   Variables not defined in a site shell script can be set in the
 environment passed to `configure'.  However, some packages may run
 configure again during the build, and the customized values of these
 variables may be lost.  In order to avoid this problem, you should set
@@ -201,12 +248,20 @@
 `configure' Invocation
 ======================
 
-`configure' recognizes the following options to control how it operates.
+   `configure' recognizes the following options to control how it
+operates.
 
 `--help'
 `-h'
-     Print a summary of the options to `configure', and exit.
+     Print a summary of all of the options to `configure', and exit.
 
+`--help=short'
+`--help=recursive'
+     Print a summary of the options unique to this package's
+     `configure', and exit.  The `short' variant lists options used
+     only in the top level, while the `recursive' variant lists options
+     also present in any nested packages.
+
 `--version'
 `-V'
      Print the version of Autoconf used to generate the `configure'
@@ -232,6 +287,16 @@
      Look for the package's source code in directory DIR.  Usually
      `configure' can determine that directory automatically.
 
+`--prefix=DIR'
+     Use DIR as the installation prefix.  *Note Installation Names::
+     for more details, including other options available for fine-tuning
+     the installation locations.
+
+`--no-create'
+`-n'
+     Run the configure checks, but stop before creating any output
+     files.
+
 `configure' also accepts some other, not widely useful, options.  Run
 `configure --help' for more details.
 

Modified: gnunet/TODO
===================================================================
--- gnunet/TODO 2009-10-28 19:47:12 UTC (rev 9331)
+++ gnunet/TODO 2009-10-28 19:52:25 UTC (rev 9332)
@@ -1,25 +1,22 @@
 Implementable right now (but not necessarily important), with caveats
 (unavailable components that will limit what can be implemented right
 away), in order in which they will likely be done:
-* TESTING
-* FS (DHT not available)
+* TESTING [Nate]
 * SETUP
-* DV (distributed testing not available)
-* TBENCH (distributed testing not available)
+* DV (distributed testing not available) [Nate]
+* TBENCH (distributed testing not available) 
 * TRACEKIT (distributed testing not available)
+* FRAGMENTATION [Ji Lu]
 * HTTP transport
-* FRAGMENTATION
-* MySQL / Postgres plugins (datastore, datacache)
-* UPNP
+* MySQL / Postgres plugins (datastore, datacache) [Radhika]
+* UPNP [Milan]
 
 Urgent items (before announcing ng.gnunet.org):
 * TESTING (needed for DV, DHT, Topology)
   - implement library for local testing
-    + modify configuration to allow controlling connections for non-local 
starts
-    + CORE service does not start with valid peer ID (all zeros) -- testcase 
fails!
-    + consider changing API for peer-group termination to call continuation 
when done
+    + consider changing API for peer-group termination to 
+      call continuation when done
   - implement testcases for library
-    + get test for basic peer start to work!
     + test basic peer connect
     + test group start
 * TEST:
@@ -89,6 +86,7 @@
     + default generation
     + need to settle basic design; do we want to keep guile?
   - testing (RC-pre0)
+    + modify configuration to allow controlling connections for non-local 
starts
     + testbed creation with topology (needs working F2F topology) [Nate]
     + testbed with churn [Nate]
     + implement library for distributed testing [Nate]
@@ -146,7 +144,7 @@
   - create good Drupal theme for GNUnet
   - make a NICE download page and figure out how to 
     enable developers to publish TGZs nicely
-  - port "contact" page; add impressum
+  - port "contact" page
   - add content type for "todo" items?
   - DNS activation
 * Plugins to implement:

Modified: gnunet/src/Makefile.am
===================================================================
--- gnunet/src/Makefile.am      2009-10-28 19:47:12 UTC (rev 9331)
+++ gnunet/src/Makefile.am      2009-10-28 19:52:25 UTC (rev 9332)
@@ -20,6 +20,7 @@
   template \
   transport \
   core \
+  testing \
   $(HOSTLIST_DIR) \
   topology \
   fs \

Modified: gnunet/src/arm/arm_api.c
===================================================================
--- gnunet/src/arm/arm_api.c    2009-10-28 19:47:12 UTC (rev 9331)
+++ gnunet/src/arm/arm_api.c    2009-10-28 19:52:25 UTC (rev 9332)
@@ -390,6 +390,7 @@
   if (0 == strcmp ("arm", service_name))
     {
       GNUNET_CLIENT_service_shutdown (h->client);
+      h->client = NULL;
       if (cb != NULL)
         cb (cb_cls, GNUNET_NO);
       return;

Modified: gnunet/src/arm/gnunet-service-arm.c
===================================================================
--- gnunet/src/arm/gnunet-service-arm.c 2009-10-28 19:47:12 UTC (rev 9331)
+++ gnunet/src/arm/gnunet-service-arm.c 2009-10-28 19:52:25 UTC (rev 9332)
@@ -536,7 +536,6 @@
           (NULL != (sc = GNUNET_CLIENT_connect (sched, servicename, cfg))) )
        {
          GNUNET_CLIENT_service_shutdown (sc);
-         GNUNET_CLIENT_disconnect (sc);
          signal_result (client, servicename, GNUNET_MESSAGE_TYPE_ARM_IS_DOWN);
        }
       else

Added: gnunet/src/fs/test_fs_namespace_data.conf
===================================================================
--- gnunet/src/fs/test_fs_namespace_data.conf                           (rev 0)
+++ gnunet/src/fs/test_fs_namespace_data.conf   2009-10-28 19:52:25 UTC (rev 
9332)
@@ -0,0 +1,42 @@
+[PATHS]
+SERVICEHOME = /tmp/gnunet-test-fs-namespace/
+DEFAULTCONFIG = test_fs_namespace_data.conf
+
+[gnunetd]
+HOSTKEY = $SERVICEHOME/.hostkey
+
+[resolver]
+PORT = 42464
+HOSTNAME = localhost
+
+[transport]
+PORT = 42465
+PLUGINS = 
+
+[arm]
+PORT = 42466
+HOSTNAME = localhost
+DEFAULTSERVICES = resolver datastore transport core fs
+
+[datastore]
+#DEBUG = YES
+
+[statistics]
+PORT = 42467
+HOSTNAME = localhost
+
+[peerinfo]
+PORT = 42469
+HOSTNAME = localhost
+
+[core]
+PORT = 42470
+HOSTNAME = localhost
+
+[fs]
+PORT = 42471
+HOSTNAME = localhost
+#DEBUG = YES
+
+[testing]
+WEAKRANDOM = YES

Modified: gnunet/src/include/gnunet_client_lib.h
===================================================================
--- gnunet/src/include/gnunet_client_lib.h      2009-10-28 19:47:12 UTC (rev 
9331)
+++ gnunet/src/include/gnunet_client_lib.h      2009-10-28 19:52:25 UTC (rev 
9332)
@@ -179,7 +179,10 @@
 
 /**
  * Request that the service should shutdown.
- * Afterwards, the connection should be disconnected.
+ * Afterwards, the connection will automatically be
+ * disconnected.  Hence the "sock" shoud not
+ * be used by the caller after this call
+ * (calling this function frees "sock" after a while).
  *
  * @param sock the socket connected to the service
  */

Modified: gnunet/src/testing/test_testing.c
===================================================================
--- gnunet/src/testing/test_testing.c   2009-10-28 19:47:12 UTC (rev 9331)
+++ gnunet/src/testing/test_testing.c   2009-10-28 19:52:25 UTC (rev 9332)
@@ -24,7 +24,7 @@
 #include "platform.h"
 #include "gnunet_testing_lib.h"
 
-#define VERBOSE GNUNET_YES
+#define VERBOSE GNUNET_NO
 
 static int ok;
 
@@ -48,7 +48,8 @@
   GNUNET_assert (id != NULL);
 #if VERBOSE
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-             "Daemon started, will now stop it.\n");
+             "Daemon `%s' started, will now stop it.\n",
+             GNUNET_i2s (id));
 #endif
   GNUNET_TESTING_daemon_stop (d, &end_cb, NULL);
 }

Modified: gnunet/src/testing/test_testing_data.conf
===================================================================
--- gnunet/src/testing/test_testing_data.conf   2009-10-28 19:47:12 UTC (rev 
9331)
+++ gnunet/src/testing/test_testing_data.conf   2009-10-28 19:52:25 UTC (rev 
9332)
@@ -8,6 +8,8 @@
 [transport]
 PORT = 2565
 PLUGINS = tcp
+#PREFIX = xterm -e xterm -T transport -e gdb -x cmd --args
+#PREFIX = valgrind --tool=memcheck --log-file=logs%p
 
 [arm]
 PORT = 2566

Modified: gnunet/src/testing/testing.c
===================================================================
--- gnunet/src/testing/testing.c        2009-10-28 19:47:12 UTC (rev 9331)
+++ gnunet/src/testing/testing.c        2009-10-28 19:52:25 UTC (rev 9332)
@@ -40,13 +40,13 @@
 #include "gnunet_testing_lib.h"
 #include "gnunet_transport_service.h"
 
-#define DEBUG_TESTING GNUNET_YES
+#define DEBUG_TESTING GNUNET_NO
 
 /**
  * How long do we wait after starting gnunet-service-arm
  * for the core service to be alive?
  */
-#define ARM_START_WAIT GNUNET_TIME_relative_multiply 
(GNUNET_TIME_UNIT_SECONDS, 2)
+#define ARM_START_WAIT GNUNET_TIME_relative_multiply 
(GNUNET_TIME_UNIT_SECONDS, 10)
 
 /**
  * How many times are we willing to try to wait for "scp" or
@@ -632,8 +632,13 @@
   ret->username = username;
 
   /* 2) copy file to remote host */  
-  if (NULL != hostname)
+  if (NULL != hostname) 
     {
+#if DEBUG_TESTING
+      GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+                 "Copying configuration file to host `%s'.\n",
+                 hostname);
+#endif
       ret->phase = SP_COPYING;
       if (NULL != username)
        GNUNET_asprintf (&arg,
@@ -732,7 +737,6 @@
                              "arm",
                              d->cfg);
   GNUNET_CLIENT_service_shutdown (cc);
-  GNUNET_CLIENT_disconnect (cc);
   
   /* state clean up and notifications */
   if (0 != UNLINK (d->cfgfile))
@@ -741,6 +745,11 @@
                              d->cfgfile);
   if (d->hostname != NULL)
     {
+#if DEBUG_TESTING
+      GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+                 "Removing configuration file on remote host `%s'.\n",
+                 d->hostname);
+#endif
       if (NULL != d->username)
        GNUNET_asprintf (&dst,
                         "address@hidden",
@@ -832,6 +841,11 @@
        cb (cb_cls, NULL); 
       return;
     }
+#if DEBUG_TESTING
+  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+             "Copying updated configuration file to remote host `%s'.\n",
+             d->hostname);
+#endif
   d->phase = SP_CONFIG_UPDATE;
   if (NULL != d->username)
     GNUNET_asprintf (&arg,
@@ -873,28 +887,30 @@
                                    d);
 }
 
+
 /**
- * FIXME.
+ * Data kept for each pair of peers that we try
+ * to connect.
  */
 struct ConnectContext
 {
   /**
-   * FIXME.
+   * Testing handle to the first daemon.
    */
   struct GNUNET_TESTING_Daemon *d1;
 
   /**
-   * FIXME.
+   * Testing handle to the second daemon.
    */
   struct GNUNET_TESTING_Daemon *d2;
 
   /**
-   * FIXME.
+   * Transport handle to the first daemon.
    */
   struct GNUNET_TRANSPORT_Handle *d1th;
 
   /**
-   * FIXME.
+   * Transport handle to the second daemon.
    */
   struct GNUNET_TRANSPORT_Handle *d2th;
 
@@ -919,7 +935,7 @@
 /**
  * Success, connection is up.  Signal client our success.
  *
- * @param cls FIXME
+ * @param cls our "struct ConnectContext"
  * @param size number of bytes available in buf
  * @param buf where to copy the message, NULL on error
  * @return number of bytes copied to buf

Modified: gnunet/src/transport/gnunet-service-transport.c
===================================================================
--- gnunet/src/transport/gnunet-service-transport.c     2009-10-28 19:47:12 UTC 
(rev 9331)
+++ gnunet/src/transport/gnunet-service-transport.c     2009-10-28 19:52:25 UTC 
(rev 9332)
@@ -2588,6 +2588,42 @@
 
 
 /**
+ * Function called when the service shuts down.  Unloads our plugins.
+ *
+ * @param cls closure, unused
+ * @param tc task context (unused)
+ */
+static void
+unload_plugins (void *cls, 
+               const struct GNUNET_SCHEDULER_TaskContext *tc)
+{
+  struct TransportPlugin *plug;
+  struct AddressList *al;
+
+#if DEBUG_TRANSPORT
+  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+              "Transport service is unloading plugins...\n");
+#endif
+  while (NULL != (plug = plugins))
+    {
+      plugins = plug->next;
+      GNUNET_break (NULL == GNUNET_PLUGIN_unload (plug->lib_name, plug->api));
+      GNUNET_free (plug->lib_name);
+      GNUNET_free (plug->short_name);
+      while (NULL != (al = plug->addresses))
+        {
+          plug->addresses = al->next;
+          GNUNET_free (al);
+        }
+      GNUNET_free (plug);
+    }
+  if (my_private_key != NULL)
+    GNUNET_CRYPTO_rsa_key_free (my_private_key);
+  GNUNET_free_non_null (our_hello);
+}
+
+
+/**
  * Initiate transport service.
  *
  * @param cls closure
@@ -2661,6 +2697,12 @@
         }
       GNUNET_free (plugs);
     }
+  GNUNET_SCHEDULER_add_delayed (sched,
+                                GNUNET_YES,
+                                GNUNET_SCHEDULER_PRIORITY_IDLE,
+                                GNUNET_SCHEDULER_NO_TASK,
+                                GNUNET_TIME_UNIT_FOREVER_REL,
+                                &unload_plugins, NULL);
   if (no_transports)
     refresh_hello ();
 #if DEBUG_TRANSPORT
@@ -2673,43 +2715,6 @@
 
 
 /**
- * Function called when the service shuts
- * down.  Unloads our plugins.
- *
- * @param cls closure
- * @param cfg configuration to use
- */
-static void
-unload_plugins (void *cls, 
-               const struct GNUNET_CONFIGURATION_Handle *cfg)
-{
-  struct TransportPlugin *plug;
-  struct AddressList *al;
-
-#if DEBUG_TRANSPORT
-  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-              "Transport service is unloading plugins...\n");
-#endif
-  while (NULL != (plug = plugins))
-    {
-      plugins = plug->next;
-      GNUNET_break (NULL == GNUNET_PLUGIN_unload (plug->lib_name, plug->api));
-      GNUNET_free (plug->lib_name);
-      GNUNET_free (plug->short_name);
-      while (NULL != (al = plug->addresses))
-        {
-          plug->addresses = al->next;
-          GNUNET_free (al);
-        }
-      GNUNET_free (plug);
-    }
-  if (my_private_key != NULL)
-    GNUNET_CRYPTO_rsa_key_free (my_private_key);
-  GNUNET_free_non_null (our_hello);
-}
-
-
-/**
  * The main function for the transport service.
  *
  * @param argc number of arguments from the command line
@@ -2723,7 +2728,7 @@
          GNUNET_SERVICE_run (argc,
                              argv,
                              "transport",
-                             &run, NULL, &unload_plugins, NULL)) ? 0 : 1;
+                             &run, NULL, NULL, NULL)) ? 0 : 1;
 }
 
 /* end of gnunet-service-transport.c */

Modified: gnunet/src/transport/plugin_transport_tcp.c
===================================================================
--- gnunet/src/transport/plugin_transport_tcp.c 2009-10-28 19:47:12 UTC (rev 
9331)
+++ gnunet/src/transport/plugin_transport_tcp.c 2009-10-28 19:52:25 UTC (rev 
9332)
@@ -2016,7 +2016,10 @@
   struct Plugin *plugin = cls;
 
   if (addr == NULL)
-    return;
+    {
+      hostname_dns = NULL;
+      return;
+    }
   process_interfaces (plugin,
                      "<hostname>",
                      GNUNET_YES,

Modified: gnunet/src/util/client.c
===================================================================
--- gnunet/src/util/client.c    2009-10-28 19:47:12 UTC (rev 9331)
+++ gnunet/src/util/client.c    2009-10-28 19:52:25 UTC (rev 9332)
@@ -468,13 +468,28 @@
 }
 
 
+/**
+ * If possible, write a shutdown message to the target
+ * buffer and destroy the client connection.
+ *
+ * @param cls the "struct GNUNET_CLIENT_Connection" to destroy
+ * @param size number of bytes available in buf
+ * @param buf NULL on error, otherwise target buffer
+ * @return number of bytes written to buf
+ */
 static size_t
 write_shutdown (void *cls, size_t size, void *buf)
 {
   struct GNUNET_MessageHeader *msg;
+  struct GNUNET_CLIENT_Connection *sock = cls;
 
+  GNUNET_CLIENT_disconnect (sock);
   if (size < sizeof (struct GNUNET_MessageHeader))
-    return 0;                   /* client disconnected */
+    {
+      GNUNET_log (GNUNET_ERROR_TYPE_INFO,
+                 _("Failed to transmit shutdown request to client.\n"));
+      return 0;                   /* client disconnected */
+    }
   msg = (struct GNUNET_MessageHeader *) buf;
   msg->type = htons (GNUNET_MESSAGE_TYPE_SHUTDOWN);
   msg->size = htons (sizeof (struct GNUNET_MessageHeader));
@@ -492,9 +507,9 @@
 GNUNET_CLIENT_service_shutdown (struct GNUNET_CLIENT_Connection *sock)
 {
   GNUNET_CONNECTION_notify_transmit_ready (sock->sock,
-                                        sizeof (struct GNUNET_MessageHeader),
-                                        GNUNET_TIME_UNIT_FOREVER_REL,
-                                        &write_shutdown, NULL);
+                                          sizeof (struct GNUNET_MessageHeader),
+                                          GNUNET_TIME_UNIT_FOREVER_REL,
+                                          &write_shutdown, sock);
 }
 
 

Modified: gnunet/src/util/test_service.c
===================================================================
--- gnunet/src/util/test_service.c      2009-10-28 19:47:12 UTC (rev 9331)
+++ gnunet/src/util/test_service.c      2009-10-28 19:52:25 UTC (rev 9332)
@@ -47,7 +47,6 @@
 
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Shutting down service\n");
   GNUNET_CLIENT_service_shutdown (client);
-  GNUNET_CLIENT_disconnect (client);
   if (sctx != NULL)
     GNUNET_SERVICE_stop (sctx);
 }





reply via email to

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