gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r3480 - in GNUnet: . m4 src/applications/fs/fsui src/applic


From: grothoff
Subject: [GNUnet-SVN] r3480 - in GNUnet: . m4 src/applications/fs/fsui src/applications/fs/tools src/applications/stats src/applications/tbench src/applications/template src/applications/tracekit src/applications/vpn src/include src/server src/setup src/util/os
Date: Thu, 12 Oct 2006 13:29:08 -0700 (PDT)

Author: grothoff
Date: 2006-10-12 13:28:59 -0700 (Thu, 12 Oct 2006)
New Revision: 3480

Modified:
   GNUnet/INSTALL
   GNUnet/ltmain.sh
   GNUnet/m4/Makefile.in
   GNUnet/src/applications/fs/fsui/fsui-loader.c
   GNUnet/src/applications/fs/fsui/fsui.c
   GNUnet/src/applications/fs/fsui/fsui.h
   GNUnet/src/applications/fs/tools/gnunet-directory.c
   GNUnet/src/applications/fs/tools/gnunet-download.c
   GNUnet/src/applications/fs/tools/gnunet-insert.c
   GNUnet/src/applications/fs/tools/gnunet-pseudonym.c
   GNUnet/src/applications/fs/tools/gnunet-search.c
   GNUnet/src/applications/fs/tools/gnunet-unindex.c
   GNUnet/src/applications/stats/gnunet-stats.c
   GNUnet/src/applications/tbench/gnunet-tbench.c
   GNUnet/src/applications/template/gnunet-template.c
   GNUnet/src/applications/tracekit/gnunet-tracekit.c
   GNUnet/src/applications/vpn/gnunet-vpn.c
   GNUnet/src/include/gnunet_util_os.h
   GNUnet/src/server/gnunet-peer-info.c
   GNUnet/src/server/gnunet-transport-check.c
   GNUnet/src/server/gnunet-update.c
   GNUnet/src/server/gnunetd.c
   GNUnet/src/setup/gnunet-setup.c
   GNUnet/src/util/os/init.c
   GNUnet/todo
Log:
partial fsui update -- breaks compilation

Modified: GNUnet/INSTALL
===================================================================
--- GNUnet/INSTALL      2006-10-12 16:07:00 UTC (rev 3479)
+++ GNUnet/INSTALL      2006-10-12 20:28:59 UTC (rev 3480)
@@ -1,13 +1,16 @@
-Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002 Free Software
-Foundation, Inc.
+Installation Instructions
+*************************
 
-   This file is free documentation; the Free Software Foundation gives
+Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005 Free
+Software Foundation, Inc.
+
+This file is free documentation; the Free Software Foundation gives
 unlimited permission to copy, distribute and modify it.
 
 Basic Installation
 ==================
 
-   These are generic installation instructions.
+These are generic installation instructions.
 
    The `configure' shell script attempts to guess correct values for
 various system-dependent variables used during compilation.  It uses
@@ -67,9 +70,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
@@ -82,7 +85,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 must use a version of `make' that
 supports the `VPATH' variable, such as GNU `make'.  `cd' to the
@@ -99,19 +102,19 @@
 Installation Names
 ==================
 
-   By default, `make install' will install the package's files in
-`/usr/local/bin', `/usr/local/man', etc.  You can specify an
-installation prefix other than `/usr/local' by giving `configure' the
-option `--prefix=PATH'.
+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'.
 
    You can specify separate installation prefixes for
 architecture-specific files and architecture-independent files.  If you
-give `configure' the option `--exec-prefix=PATH', the package will use
-PATH as the prefix for installing programs and libraries.
-Documentation and other data files will still use the regular prefix.
+pass the option `--exec-prefix=PREFIX' to `configure', the package uses
+PREFIX as the prefix for installing programs and libraries.
+Documentation and other data files still use the regular prefix.
 
    In addition, if you use an unusual directory layout you can give
-options like `--bindir=PATH' to specify different values for particular
+options like `--bindir=DIR' to specify different values for particular
 kinds of files.  Run `configure --help' for a list of the directories
 you can set and what kinds of files go in them.
 
@@ -122,7 +125,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
@@ -137,11 +140,11 @@
 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:
 
@@ -156,7 +159,7 @@
 need to know the machine type.
 
    If you are _building_ compiler tools for cross-compiling, you should
-use the `--target=TYPE' option to select the type of system they will
+use the option `--target=TYPE' to select the type of system they will
 produce code for.
 
    If you want to _use_ a cross compiler, that generates code for a
@@ -167,9 +170,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.
@@ -178,7 +181,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
@@ -186,14 +189,18 @@
 
      ./configure CC=/usr/local2/bin/gcc
 
-will cause the specified gcc to be used as the C compiler (unless it is
-overridden in the site shell script).
+causes the specified `gcc' to be used as the C compiler (unless it is
+overridden in the site shell script).  Here is a another example:
 
+     /bin/bash ./configure CONFIG_SHELL=/bin/bash
+
+Here the `CONFIG_SHELL=/bin/bash' operand causes subsequent
+configuration-related scripts to be executed by `/bin/bash'.
+
 `configure' Invocation
 ======================
 
-   `configure' recognizes the following options to control how it
-operates.
+`configure' recognizes the following options to control how it operates.
 
 `--help'
 `-h'

Modified: GNUnet/ltmain.sh
===================================================================
--- GNUnet/ltmain.sh    2006-10-12 16:07:00 UTC (rev 3479)
+++ GNUnet/ltmain.sh    2006-10-12 20:28:59 UTC (rev 3480)
@@ -43,7 +43,7 @@
 
 PROGRAM=ltmain.sh
 PACKAGE=libtool
-VERSION="1.5.22 Debian 1.5.22-4"
+VERSION=1.5.22
 TIMESTAMP=" (1.1220.2.365 2005/12/18 22:14:06)"
 
 # See if we are running on zsh, and set the options which allow our
@@ -2082,10 +2082,7 @@
        case $pass in
        dlopen) libs="$dlfiles" ;;
        dlpreopen) libs="$dlprefiles" ;;
-       link)
-         libs="$deplibs %DEPLIBS%"
-         test "X$link_all_deplibs" != Xno && libs="$libs $dependency_libs"
-         ;;
+       link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
        esac
       fi
       if test "$pass" = dlopen; then
@@ -3204,11 +3201,6 @@
            age="$number_minor"
            revision="$number_minor"
            ;;
-         *)
-           $echo "$modename: unknown library version type \`$version_type'" 
1>&2
-           $echo "Fatal configuration error.  See the $PACKAGE docs for more 
information." 1>&2
-           exit $EXIT_FAILURE
-           ;;
          esac
          ;;
        no)

Modified: GNUnet/m4/Makefile.in
===================================================================
--- GNUnet/m4/Makefile.in       2006-10-12 16:07:00 UTC (rev 3479)
+++ GNUnet/m4/Makefile.in       2006-10-12 20:28:59 UTC (rev 3480)
@@ -1,8 +1,8 @@
-# Makefile.in generated by automake 1.8.5 from Makefile.am.
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004  Free Software Foundation, Inc.
+# 2003, 2004, 2005  Free Software Foundation, Inc.
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
@@ -33,6 +33,7 @@
 NORMAL_UNINSTALL = :
 PRE_UNINSTALL = :
 POST_UNINSTALL = :
+build_triplet = @build@
 host_triplet = @host@
 subdir = m4
 DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ChangeLog
@@ -93,7 +94,6 @@
 GMSGFMT = @GMSGFMT@
 GNUNETGTK_CFLAGS = @GNUNETGTK_CFLAGS@
 GNUNETGTK_LIBS = @GNUNETGTK_LIBS@
-GREP = @GREP@
 GTK_CFLAGS = @GTK_CFLAGS@
 GTK_LIBS = @GTK_LIBS@
 GUILE = @GUILE@
@@ -173,9 +173,15 @@
 XFREEBSD_TRUE = @XFREEBSD_TRUE@
 XGETTEXT = @XGETTEXT@
 _libcurl_config = @_libcurl_config@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_AS = @ac_ct_AS@
 ac_ct_CC = @ac_ct_CC@
 ac_ct_CXX = @ac_ct_CXX@
+ac_ct_DLLTOOL = @ac_ct_DLLTOOL@
 ac_ct_F77 = @ac_ct_F77@
+ac_ct_OBJDUMP = @ac_ct_OBJDUMP@
+ac_ct_RANLIB = @ac_ct_RANLIB@
+ac_ct_STRIP = @ac_ct_STRIP@
 am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
 am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
 am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
@@ -183,6 +189,8 @@
 am__include = @am__include@
 am__leading_dot = @am__leading_dot@
 am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
 bindir = @bindir@
 build = @build@
 build_alias = @build_alias@
@@ -190,30 +198,23 @@
 build_os = @build_os@
 build_vendor = @build_vendor@
 datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
 exec_prefix = @exec_prefix@
 host = @host@
 host_alias = @host_alias@
 host_cpu = @host_cpu@
 host_os = @host_os@
 host_vendor = @host_vendor@
-htmldir = @htmldir@
 includedir = @includedir@
 infodir = @infodir@
 install_sh = @install_sh@
 libdir = @libdir@
 libexecdir = @libexecdir@
-localedir = @localedir@
 localstatedir = @localstatedir@
 mandir = @mandir@
 mkdir_p = @mkdir_p@
 oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
-psdir = @psdir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 subdirs = @subdirs@
@@ -355,7 +356,7 @@
 clean-generic:
 
 distclean-generic:
-       -rm -f $(CONFIG_CLEAN_FILES)
+       -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
 
 maintainer-clean-generic:
        @echo "This command is intended for maintainers to use"

Modified: GNUnet/src/applications/fs/fsui/fsui-loader.c
===================================================================
--- GNUnet/src/applications/fs/fsui/fsui-loader.c       2006-10-12 16:07:00 UTC 
(rev 3479)
+++ GNUnet/src/applications/fs/fsui/fsui-loader.c       2006-10-12 20:28:59 UTC 
(rev 3480)
@@ -70,7 +70,6 @@
   if (argc != 2) {
     fprintf(stderr,
            "Call with name of FSUI resource file!\n");
-    os_done();
     return -1;
   }
   ctx = FSUI_start(ectx,
@@ -85,6 +84,5 @@
   else 
     fprintf(stderr,
            "FSUI_start failed!\n");  
-  os_done();
   return (ctx == NULL);
 }

Modified: GNUnet/src/applications/fs/fsui/fsui.c
===================================================================
--- GNUnet/src/applications/fs/fsui/fsui.c      2006-10-12 16:07:00 UTC (rev 
3479)
+++ GNUnet/src/applications/fs/fsui/fsui.c      2006-10-12 20:28:59 UTC (rev 
3480)
@@ -251,6 +251,15 @@
   FREE(buf);
 }
 
+static void WRITESTRING(int fd,
+                       const char * name) {
+  WRITEINT(fd,
+          strlen(name));
+  WRITE(fd,
+       name,
+       strlen(name));
+}
+
 /**
  * (recursively) write a download list.
  */
@@ -698,6 +707,20 @@
                           &ret->activeDownloads);
       doResumeEvents(ret->activeDownloads.child,
                     ret);
+
+      /* deserialize uploads */
+      while (1) {
+       if (sizeof(unsigned int) !=
+           READ(fd, &big, sizeof(unsigned int))) {
+         GE_BREAK(ectx, 0);
+         goto WARN;
+       }
+       if (ntohl(big) != 1) 
+         break; /* no more uploads */
+       
+
+      }
+
       /* success, read complete! */
       goto END;
     WARNL:
@@ -954,12 +977,33 @@
          sizeof(unsigned int));
   }
   while (ctx->activeUploads != NULL) {
+    big = htonl(1);
+    WRITE(fd,
+         &big,
+         sizeof(unsigned int));
     upos = ctx->activeUploads;
     ctx->activeUploads = upos->next;
     upos->force_termination = YES;
     PTHREAD_STOP_SLEEP(upos->handle);
     PTHREAD_JOIN(upos->handle, &unused);
     if (fd != -1) {
+      WRITEINT(fd, upos->status);
+      WRITELONG(fd, upos->main_completed);
+      WRITELONG(fd, upos->main_total);
+      WRITELONG(fd, upos->expiration);
+      WRITELONG(fd, upos->start_time);
+      /* dir track!? */
+      writeURI(fd, upos->uri);
+      writeURI(fd, upos->globalUri); /* need to handle NULL? */
+      WRITESTRING(fd, upos->filename);
+      WRITESTRING(fd, upos->main_filename);
+      WRITEINT(fd, upos->isRecursive);
+      WRITEINT(fd, upos->doIndex);
+      WRITEINT(fd, upos->anonymityLevel);
+      WRITEINT(fd, upos->priority);
+      WRITEINT(fd, upos->individualKeywords);
+      
+
       /* FIXME: serialize! */
       event.type = FSUI_upload_suspending;
       event.data.UploadSuspending.uc.pos = upos;
@@ -974,6 +1018,7 @@
     if (upos->globalUri != NULL)
       ECRS_freeUri(upos->globalUri);
     EXTRACTOR_removeAll(upos->extractors);
+    FREE(upos);
   }
   if (fd != -1) {
     /* upload list terminator */

Modified: GNUnet/src/applications/fs/fsui/fsui.h
===================================================================
--- GNUnet/src/applications/fs/fsui/fsui.h      2006-10-12 16:07:00 UTC (rev 
3479)
+++ GNUnet/src/applications/fs/fsui/fsui.h      2006-10-12 20:28:59 UTC (rev 
3480)
@@ -142,10 +142,13 @@
 
   void * cctx;
 
+  FSUI_State state;
+
 } FSUI_SearchList;
 
 /**
- * Current state of a download.
+ * Current state of a download (or uploads, or search,
+ * or unindex operations).
  *
  * PENDING means that the download is waiting for a thread
  * to be assigned to run it.  Downloads start in this state,
@@ -189,18 +192,19 @@
  * resumes).
  */
 typedef enum {
-  FSUI_DOWNLOAD_PENDING = 0,
-  FSUI_DOWNLOAD_ACTIVE = 1,
-  FSUI_DOWNLOAD_COMPLETED = 2,
-  FSUI_DOWNLOAD_COMPLETED_JOINED = 3,
-  FSUI_DOWNLOAD_ABORTED = 4,
-  FSUI_DOWNLOAD_ABORTED_JOINED = 5,
-  FSUI_DOWNLOAD_ERROR = 6,
-  FSUI_DOWNLOAD_ERROR_JOINED = 7,
-  FSUI_DOWNLOAD_SUSPENDING = 8,
-} FSUI_DownloadState;
+  FSUI_PENDING = 0,
+  FSUI_ACTIVE = 1,
+  FSUI_COMPLETED = 2,
+  FSUI_COMPLETED_JOINED = 3,
+  FSUI_ABORTED = 4,
+  FSUI_ABORTED_JOINED = 5,
+  FSUI_ERROR = 6,
+  FSUI_ERROR_JOINED = 7,
+  FSUI_SUSPENDING = 8,
+} FSUI_State;
 
 
+
 /**
  * @brief list of active downloads
  */
@@ -313,7 +317,7 @@
   /**
    * State of the download.
    */
-  FSUI_DownloadState state;
+  FSUI_State state;
 
 } FSUI_DownloadList;
 
@@ -336,6 +340,8 @@
 
   int force_termination;
 
+  FSUI_State state;
+
 } FSUI_UnindexList;
 
 /**
@@ -394,6 +400,8 @@
 
   int force_termination;
 
+  FSUI_State state;
+
 } FSUI_UploadList;
 
 /**

Modified: GNUnet/src/applications/fs/tools/gnunet-directory.c
===================================================================
--- GNUnet/src/applications/fs/tools/gnunet-directory.c 2006-10-12 16:07:00 UTC 
(rev 3479)
+++ GNUnet/src/applications/fs/tools/gnunet-directory.c 2006-10-12 20:28:59 UTC 
(rev 3480)
@@ -176,7 +176,6 @@
   if (i == SYSERR) {
     GC_free(cfg);
     GE_free_context(ectx);
-    os_done();
     return -1;  
   }
   if (do_list)
@@ -198,8 +197,6 @@
 
   GC_free(cfg);
   GE_free_context(ectx);
-  os_done();
-
   return 0;
 }
 

Modified: GNUnet/src/applications/fs/tools/gnunet-download.c
===================================================================
--- GNUnet/src/applications/fs/tools/gnunet-download.c  2006-10-12 16:07:00 UTC 
(rev 3479)
+++ GNUnet/src/applications/fs/tools/gnunet-download.c  2006-10-12 20:28:59 UTC 
(rev 3480)
@@ -167,7 +167,6 @@
   if (i == SYSERR) {
     GC_free(cfg);
     GE_free_context(ectx);
-    os_done();
     return -1;  
   }
 
@@ -178,7 +177,6 @@
             "You must specify a GNUnet file URI\n"));
     GC_free(cfg);
     GE_free_context(ectx);
-    os_done();
     return -1;
   }
   GC_get_configuration_value_number(cfg,
@@ -199,7 +197,6 @@
           argv[i]);
     GC_free(cfg);
     GE_free_context(ectx);
-    os_done();
     return -1;
   }
 
@@ -255,7 +252,6 @@
   ECRS_freeUri(uri);
   GC_free(cfg);
   GE_free_context(ectx);
-  os_done();
   if (dl == NULL)
     return 1;
   return 0;

Modified: GNUnet/src/applications/fs/tools/gnunet-insert.c
===================================================================
--- GNUnet/src/applications/fs/tools/gnunet-insert.c    2006-10-12 16:07:00 UTC 
(rev 3479)
+++ GNUnet/src/applications/fs/tools/gnunet-insert.c    2006-10-12 20:28:59 UTC 
(rev 3480)
@@ -477,7 +477,6 @@
 quit:
   GC_free(cfg);
   GE_free_context(ectx);
-  os_done();
   return errorCode;
 }
 

Modified: GNUnet/src/applications/fs/tools/gnunet-pseudonym.c
===================================================================
--- GNUnet/src/applications/fs/tools/gnunet-pseudonym.c 2006-10-12 16:07:00 UTC 
(rev 3479)
+++ GNUnet/src/applications/fs/tools/gnunet-pseudonym.c 2006-10-12 20:28:59 UTC 
(rev 3480)
@@ -211,7 +211,6 @@
     GC_free(cfg);
     GE_free_context(ectx);
     ECRS_freeMetaData(meta);
-    os_done();
     return -1;  
   }
   success = 0; /* no errors */
@@ -330,7 +329,6 @@
   ECRS_freeMetaData(meta);
   GC_free(cfg);
   GE_free_context(ectx);
-  os_done();
   return success;
 }
 

Modified: GNUnet/src/applications/fs/tools/gnunet-search.c
===================================================================
--- GNUnet/src/applications/fs/tools/gnunet-search.c    2006-10-12 16:07:00 UTC 
(rev 3479)
+++ GNUnet/src/applications/fs/tools/gnunet-search.c    2006-10-12 20:28:59 UTC 
(rev 3480)
@@ -264,7 +264,6 @@
   if (i == SYSERR) {
     GC_free(cfg);
     GE_free_context(ectx);
-    os_done();
     return -1;  
   }
 
@@ -279,7 +278,6 @@
     printf(_("Error converting arguments to URI!\n"));
     GC_free(cfg);
     GE_free_context(ectx);
-    os_done();
     return -1;
   }
 
@@ -301,7 +299,6 @@
   cron_destroy(cron);
   GC_free(cfg);
   GE_free_context(ectx);
-  os_done();
   if (ret == OK)
     return 0;
   else

Modified: GNUnet/src/applications/fs/tools/gnunet-unindex.c
===================================================================
--- GNUnet/src/applications/fs/tools/gnunet-unindex.c   2006-10-12 16:07:00 UTC 
(rev 3479)
+++ GNUnet/src/applications/fs/tools/gnunet-unindex.c   2006-10-12 20:28:59 UTC 
(rev 3480)
@@ -138,7 +138,6 @@
   if (i == SYSERR) {
     GC_free(cfg);
     GE_free_context(ectx);
-    os_done();
     return -1;  
   }
   if (i == argc) {
@@ -148,7 +147,6 @@
             "You must specify a filename.\n"));
     GC_free(cfg);
     GE_free_context(ectx);
-    os_done();
     return -1;
   }
   GC_get_configuration_value_number(cfg,
@@ -187,7 +185,6 @@
   SEMAPHORE_DESTROY(exitSignal);
   GC_free(cfg);
   GE_free_context(ectx);
-  os_done();
   return errorCode;
 }
 

Modified: GNUnet/src/applications/stats/gnunet-stats.c
===================================================================
--- GNUnet/src/applications/stats/gnunet-stats.c        2006-10-12 16:07:00 UTC 
(rev 3479)
+++ GNUnet/src/applications/stats/gnunet-stats.c        2006-10-12 20:28:59 UTC 
(rev 3480)
@@ -128,7 +128,6 @@
                                 argv)) {
     GC_free(cfg);
     GE_free_context(ectx);
-    os_done();
     return -1;  
   }
   sock = client_connection_create(ectx,
@@ -136,7 +135,6 @@
   if (sock == NULL) {
     fprintf(stderr,
            _("Error establishing connection with gnunetd.\n"));
-    os_done();
     return 1;
   }
   res = requestStatistics(ectx,
@@ -159,7 +157,6 @@
   connection_destroy(sock);
   GC_free(cfg);
   GE_free_context(ectx);
-  os_done();
 
   return (res == OK) ? 0 : 1;
 }

Modified: GNUnet/src/applications/tbench/gnunet-tbench.c
===================================================================
--- GNUnet/src/applications/tbench/gnunet-tbench.c      2006-10-12 16:07:00 UTC 
(rev 3479)
+++ GNUnet/src/applications/tbench/gnunet-tbench.c      2006-10-12 20:28:59 UTC 
(rev 3480)
@@ -127,7 +127,6 @@
                                 argv)) {
     GC_free(cfg);
     GE_free_context(ectx);
-    os_done();
     return -1;  
   }
   sock = client_connection_create(ectx,
@@ -137,7 +136,6 @@
            _("Error establishing connection with gnunetd.\n"));
     GC_free(cfg);
     GE_free_context(ectx);
-    os_done();
     return 1;
   }
 
@@ -156,7 +154,6 @@
     connection_destroy(sock);
     GC_free(cfg);
     GE_free_context(ectx);
-    os_done();
     return 1;
   }
   if (OK != enc2hash(messageReceiver,
@@ -164,18 +161,19 @@
     fprintf(stderr,
            _("Invalid receiver peer ID specified (`%s' is not valid name).\n"),
            messageReceiver);
+    FREE(messageReceiver);
     connection_destroy(sock);
     GC_free(cfg);
     GE_free_context(ectx);
-    os_done();
     return 1;
   }
   FREE(messageReceiver);
 
   if (SYSERR == connection_write(sock,
-                                &msg.header))
-  {
-    os_done();
+                                &msg.header)) {
+    connection_destroy(sock);
+    GC_free(cfg);
+    GE_free_context(ectx);
     return -1;
   }
 
@@ -228,7 +226,6 @@
   connection_destroy(sock);
   GC_free(cfg);
   GE_free_context(ectx);
-  os_done();
   return 0;
 }
 

Modified: GNUnet/src/applications/template/gnunet-template.c
===================================================================
--- GNUnet/src/applications/template/gnunet-template.c  2006-10-12 16:07:00 UTC 
(rev 3479)
+++ GNUnet/src/applications/template/gnunet-template.c  2006-10-12 20:28:59 UTC 
(rev 3480)
@@ -91,7 +91,6 @@
                                 argv)) {
     GC_free(cfg);
     GE_free_context(ectx);
-    os_done();
     return -1;  
   }
 
@@ -102,7 +101,6 @@
            _("Error establishing connection with gnunetd.\n"));
     GC_free(cfg);
     GE_free_context(ectx);
-    os_done();
     return 1;
   }
   messageReceiveThread = PTHREAD_CREATE(&receiveThread,
@@ -123,7 +121,6 @@
   connection_destroy(sock);
   GC_free(cfg);
   GE_free_context(ectx);
-  os_done();
   return 0;
 }
 

Modified: GNUnet/src/applications/tracekit/gnunet-tracekit.c
===================================================================
--- GNUnet/src/applications/tracekit/gnunet-tracekit.c  2006-10-12 16:07:00 UTC 
(rev 3479)
+++ GNUnet/src/applications/tracekit/gnunet-tracekit.c  2006-10-12 20:28:59 UTC 
(rev 3480)
@@ -311,7 +311,6 @@
                                 argv)) {
     GC_free(cfg);
     GE_free_context(ectx);
-    os_done();
     return -1;  
   }
   sock = client_connection_create(ectx, cfg);
@@ -320,7 +319,6 @@
            _("Error establishing connection with gnunetd.\n"));
     GC_free(cfg);
     GE_free_context(ectx);
-    os_done();
     return 1;
   }
 
@@ -374,7 +372,6 @@
   cron_destroy(cron);
   GC_free(cfg);
   GE_free_context(ectx);
-  os_done();
   return 0;
 }
 

Modified: GNUnet/src/applications/vpn/gnunet-vpn.c
===================================================================
--- GNUnet/src/applications/vpn/gnunet-vpn.c    2006-10-12 16:07:00 UTC (rev 
3479)
+++ GNUnet/src/applications/vpn/gnunet-vpn.c    2006-10-12 20:28:59 UTC (rev 
3480)
@@ -60,11 +60,10 @@
   COMMAND_LINE_OPTION_END,
 };
 
-static void * receiveThread(struct ClientServerConnection * sock) {
-  /* printf("Welcome to the VPN console: (Ctrl-D to exit)\n"); */
-  /* MESSAGE_HEADER *buffer; */
+static void * receiveThread(void * arg) {
+  struct ClientServerConnection * sock = arg;
   char buffer[MAX_BUFFER_SIZE];
-  MESSAGE_HEADER* bufp = buf;
+  MESSAGE_HEADER * bufp = buf;
       
   /* buffer = MALLOC(MAX_BUFFER_SIZE); */
   while (OK == connection_read(sock, &bufp)) {
@@ -144,7 +143,6 @@
                                 argv)) {
     GC_free(cfg);
     GE_free_context(ectx);
-    os_done();
     return -1;  
   }
   sock = client_connection_create(ectx,
@@ -152,7 +150,8 @@
   if (sock == NULL) {
     fprintf(stderr,
            _("Error establishing connection with gnunetd.\n"));
-    os_done();
+    GC_free(cfg);
+    GE_free_context(ectx);
     return 1;
   }
 
@@ -162,7 +161,7 @@
   lock = MUTEX_CREATE(NO);
   wantExit = NO;
 
-  messageReceiveThread = PTHREAD_CREATE((PThreadMain) &receiveThread,
+  messageReceiveThread = PTHREAD_CREATE(&receiveThread,
                                        sock,
                                        128 * 1024);
   if (messageReceiveThread == NULL)

Modified: GNUnet/src/include/gnunet_util_os.h
===================================================================
--- GNUnet/src/include/gnunet_util_os.h 2006-10-12 16:07:00 UTC (rev 3479)
+++ GNUnet/src/include/gnunet_util_os.h 2006-10-12 20:28:59 UTC (rev 3480)
@@ -312,11 +312,6 @@
  */
 int os_init(struct GE_Context *ectx);
 
-/**
- * @brief Perform OS specific cleanup
- */
-void os_done(void);
-
 #if 0 /* keep Emacsens' auto-indent happy */
 {
 #endif

Modified: GNUnet/src/server/gnunet-peer-info.c
===================================================================
--- GNUnet/src/server/gnunet-peer-info.c        2006-10-12 16:07:00 UTC (rev 
3479)
+++ GNUnet/src/server/gnunet-peer-info.c        2006-10-12 20:28:59 UTC (rev 
3480)
@@ -124,14 +124,12 @@
                                 argv)) {
     GC_free(cfg);
     GE_free_context(ectx);
-    os_done();
     return -1;  
   } 
   if (-1 == GC_parse_configuration(cfg,
                                   cfgFilename)) {
     GC_free(cfg);
     GE_free_context(ectx);
-    os_done();
     return -1;  
   }
   GE_ASSERT(ectx,
@@ -153,7 +151,6 @@
   cron_destroy(cron);
   GC_free(cfg);
   GE_free_context(ectx);
-  os_done();
   return 0;
 }
 

Modified: GNUnet/src/server/gnunet-transport-check.c
===================================================================
--- GNUnet/src/server/gnunet-transport-check.c  2006-10-12 16:07:00 UTC (rev 
3479)
+++ GNUnet/src/server/gnunet-transport-check.c  2006-10-12 20:28:59 UTC (rev 
3480)
@@ -401,20 +401,17 @@
                                 argv)) {
     GC_free(cfg);
     GE_free_context(ectx);
-    os_done();
     return -1;  
   }
   if (-1 == GC_parse_configuration(cfg,
                                   cfgFilename)) {
     GC_free(cfg);
     GE_free_context(ectx);
-    os_done();
     return -1;  
   }
   if (OK != changeUser(ectx, cfg)) {
     GC_free(cfg);
     GE_free_context(ectx);
-    os_done();
     return -1;
   }
 
@@ -542,7 +539,6 @@
   cron_destroy(cron);
   GC_free(cfg);
   GE_free_context(ectx);
-  os_done();
  
   if (res == OK)
     return 0;

Modified: GNUnet/src/server/gnunet-update.c
===================================================================
--- GNUnet/src/server/gnunet-update.c   2006-10-12 16:07:00 UTC (rev 3479)
+++ GNUnet/src/server/gnunet-update.c   2006-10-12 20:28:59 UTC (rev 3480)
@@ -253,20 +253,17 @@
                                 argv)) {
     GC_free(cfg);
     GE_free_context(ectx);
-    os_done();
     return -1;  
   }
   if (-1 == GC_parse_configuration(cfg,
                                   cfgFilename)) {
     GC_free(cfg);
     GE_free_context(ectx);
-    os_done();
     return -1;  
   }
   if (OK != changeUser(ectx, cfg)) {
     GC_free(cfg);
     GE_free_context(ectx);
-    os_done();
     return -1;
   }
   if (0 == GC_get_configuration_value_string(cfg,
@@ -281,7 +278,6 @@
   }
   GC_free(cfg);
   GE_free_context(ectx);
-  os_done();
 
   return 0;
 }

Modified: GNUnet/src/server/gnunetd.c
===================================================================
--- GNUnet/src/server/gnunetd.c 2006-10-12 16:07:00 UTC (rev 3479)
+++ GNUnet/src/server/gnunetd.c 2006-10-12 20:28:59 UTC (rev 3480)
@@ -216,20 +216,17 @@
                                 argv)) {
     GC_free(cfg);
     GE_free_context(ectx);
-    os_done();
     return -1;  
   }
   if (-1 == GC_parse_configuration(cfg,
                                   cfgFilename)) {
     GC_free(cfg);
     GE_free_context(ectx);
-    os_done();
     return -1;  
   }
   if (OK != changeUser(ectx, cfg)) {
     GC_free(cfg);
     GE_free_context(ectx);
-    os_done();
     return 1;
   }
   if (OK != checkUpToDate(ectx,
@@ -240,14 +237,11 @@
           "gnunet-update");
     GC_free(cfg);
     GE_free_context(ectx);
-    os_done();
     return 1;
   }  
   ret = gnunet_main(ectx);
   GC_free(cfg);
-  os_done();
   GE_free_context(ectx);
-  os_done();
   if (ret != OK)
     return 1;
   return 0;

Modified: GNUnet/src/setup/gnunet-setup.c
===================================================================
--- GNUnet/src/setup/gnunet-setup.c     2006-10-12 16:07:00 UTC (rev 3479)
+++ GNUnet/src/setup/gnunet-setup.c     2006-10-12 20:28:59 UTC (rev 3480)
@@ -145,14 +145,12 @@
   if (i < 0) {
     GC_free(cfg);
     GE_free_context(ectx);
-    os_done();
     return -1;  
   }
   if (i != argc - 1) {
     if (i < argc - 1) {
       fprintf(stderr,
              _("Too many arguments.\n"));
-      os_done();
       return -1;
     }
     GE_LOG(ectx,
@@ -213,7 +211,6 @@
     GC_free(cfg);
     GE_free_context(ectx);
     FREE(cfgFilename);
-    os_done();
     return -1;
   }
 
@@ -234,7 +231,6 @@
        GNS_free_specification(gns);
        GC_free(cfg);
        GE_free_context(ectx);
-  os_done();
        FREE(cfgFilename);
        return -1;
       } else {
@@ -253,12 +249,10 @@
     GNS_free_specification(gns);
     GC_free(cfg);
     GE_free_context(ectx);
-    os_done();
     return 1;
   }
   GNS_free_specification(gns);
   GC_free(cfg);
   GE_free_context(ectx);
-  os_done();
   return 0;
 }

Modified: GNUnet/src/util/os/init.c
===================================================================
--- GNUnet/src/util/os/init.c   2006-10-12 16:07:00 UTC (rev 3479)
+++ GNUnet/src/util/os/init.c   2006-10-12 20:28:59 UTC (rev 3480)
@@ -45,7 +45,7 @@
 /**
  * @brief Perform OS specific cleanup
  */
-void os_done()
+void __attribute__ ((destructor)) os_fini()
 {
 #ifdef MINGW
   ShutdownWinEnv();

Modified: GNUnet/todo
===================================================================
--- GNUnet/todo 2006-10-12 16:07:00 UTC (rev 3479)
+++ GNUnet/todo 2006-10-12 20:28:59 UTC (rev 3480)
@@ -21,8 +21,6 @@
       @ generate events for suspend, abort, resume
       @ properly initialize and destruct cctx contexts
       @ make sure new event fields are set for all events
-    + uridb (?):
-      @ slow gnunet-gtk iterator (see drupal)
     + fs/fslib: error handing
     + fs/module: error handing
     + fs/ecrs: test-terminate integration (upload, unindex)





reply via email to

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