gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r712 - in GNUnet: . contrib doc/man src/applications/fs/ecr


From: grothoff
Subject: [GNUnet-SVN] r712 - in GNUnet: . contrib doc/man src/applications/fs/ecrs src/applications/topology_f2f src/include src/server src/util
Date: Sun, 1 May 2005 04:54:07 -0700 (PDT)

Author: grothoff
Date: 2005-05-01 04:53:45 -0700 (Sun, 01 May 2005)
New Revision: 712

Modified:
   GNUnet/README
   GNUnet/configure.ac
   GNUnet/contrib/gnunet.root
   GNUnet/contrib/gnunet.user
   GNUnet/doc/man/Makefile.am
   GNUnet/doc/man/gnunet-man-template
   GNUnet/doc/man/gnunet-peer-info.1
   GNUnet/doc/man/gnunet-transport-check.1
   GNUnet/doc/man/gnunet.conf.5
   GNUnet/doc/man/gnunetd.1
   GNUnet/mkinstalldirs
   GNUnet/src/applications/fs/ecrs/upload.c
   GNUnet/src/applications/topology_f2f/topology.c
   GNUnet/src/include/gnunet_util.h
   GNUnet/src/server/gnunet-peer-info.c
   GNUnet/src/server/tcpserver.c
   GNUnet/src/util/configuration.c
   GNUnet/src/util/generate
   GNUnet/todo
Log:
update

Modified: GNUnet/README
===================================================================
--- GNUnet/README       2005-04-30 09:18:08 UTC (rev 711)
+++ GNUnet/README       2005-05-01 11:53:45 UTC (rev 712)
@@ -25,8 +25,7 @@
 
 The fastest way is to use a binary package if it is available for your
 system.  For a more detailed description, read the installation
-instructions on the webpage at
-http://gnunet.org/documentation.php3.
+instructions on the webpage at http://gnunet.org/documentation.php3.
 
 If you install from source, you need to install libextractor
 first (download from http://gnunet.org/libextractor/).  Then
@@ -35,24 +34,27 @@
 $ ./configure --prefix=$HOME --with-extractor=$HOME
 $ make
 # make install
-# cp contrib/gnunet.root /etc/gnunet.conf
-# cp contrib/initgnunet /etc/init.d/gnunetd
+# gnunetd 
 
-This will compile and install GNUnet to ~/bin/, ~/lib/ and ~/man/ and
-put the configuration file where gnunetd expect it.  Note that
-per-user configuration files (~/.gnunet/gnunet.conf) will be created
-the first time a user starts a GNUnet user interface.  For more
-general information about the GNU build process read the INSTALL file.
+This will compile and install GNUnet to ~/bin/, ~/lib/ and ~/man/.
+Starting gnunetd as root the first time will allow the daemon to
+create the default configuration file in /etc/gnunetd.conf.  If you do
+not want to run GNUnet as root, add a user gnunet and give it write
+permissions to /var/lib/GNUnet (and start gnunetd as that user in the
+future).  Note that additional, per-user configuration files
+(~/.gnunet/gnunet.conf) will be created the first time a user starts a
+GNUnet user interface.  For more general information about the GNU
+build process read the INSTALL file.
 
 GNUnet requires the GNU MP library (http://www.gnu.org/software/gmp/)
-and libgcrypt.  You can specify the path to
-libgcrypt using "--with-gcrypt=PATH".
+and libgcrypt.  You can specify the path to libgcrypt by passing
+"--with-gcrypt=PATH" to configure.
 
-If you are compiling the CVS version, you have to run ". bootstrap"
-before ./configure.  If you receive an error during the running of
-". bootstrap" that looks like "macro `AM_PATH_GTK' not found in
-library", you may need to run aclocal by hand with the -I option,
-pointing to your aclocal m4 macros, i.e.
+If you are compiling the code from subversion, you have to run
+". bootstrap" before ./configure.  If you receive an error during the
+running of ". bootstrap" that looks like "macro `AM_PATH_GTK' not
+found in library", you may need to run aclocal by hand with the -I
+option, pointing to your aclocal m4 macros, i.e.
 
 # aclocal -I /usr/local/share/aclocal
 
@@ -67,9 +69,9 @@
 currently support MySQL and SQLite.
 
 libextractor >= 0.4.2 is required
-autoconf >= 2.59 is recommended for compiling the SVN version.
+autoconf >= 2.59 is  recommended for compiling the SVN version.
 automake >= 1.9.4 is recommended for compiling the SVN version.
-libtool >= 1.5.8 is recommended for compiling the SVN version.
+libtool >= 1.5.8 is  recommended for compiling the SVN version.
 
 
 Configuration

Modified: GNUnet/configure.ac
===================================================================
--- GNUnet/configure.ac 2005-04-30 09:18:08 UTC (rev 711)
+++ GNUnet/configure.ac 2005-05-01 11:53:45 UTC (rev 712)
@@ -21,8 +21,8 @@
 #
 #
 AC_PREREQ(2.57)
-AC_INIT([GNUnet], [0.7.0pre2],address@hidden)
-AM_INIT_AUTOMAKE([GNUnet], [0.7.0pre2])
+AC_INIT([GNUnet], [0.7.0pre2-svn],address@hidden)
+AM_INIT_AUTOMAKE([GNUnet], [0.7.0pre2-svn])
 AM_CONFIG_HEADER([config.h])
 
 AH_TOP([#define _GNU_SOURCE  1])

Modified: GNUnet/contrib/gnunet.root
===================================================================
--- GNUnet/contrib/gnunet.root  2005-04-30 09:18:08 UTC (rev 711)
+++ GNUnet/contrib/gnunet.root  2005-05-01 11:53:45 UTC (rev 712)
@@ -32,7 +32,7 @@
 # up to the (global) quota specified below.  Having a few gigabytes
 # of free space is recommended.
 # Default: GNUNETD_HOME     = /var/lib/GNUnet
-GNUNETD_HOME     = /var/lib/GNUnet
+# GNUNETD_HOME     = /var/lib/GNUnet
 
 #########################################
 # Options for the GNUnet server, gnunetd
@@ -557,10 +557,7 @@
 # Default is $GNUNETD_HOME/data/shared/
 INDEX-DIRECTORY = $GNUNETD_HOME/data/shared/
 
-# Indexing quota.  Default is 8192.
-INDEX-QUOTA = 8192
 
-
 #######################################
 # MySQL specific options.
 #######################################

Modified: GNUnet/contrib/gnunet.user
===================================================================
--- GNUnet/contrib/gnunet.user  2005-04-30 09:18:08 UTC (rev 711)
+++ GNUnet/contrib/gnunet.user  2005-05-01 11:53:45 UTC (rev 712)
@@ -11,7 +11,7 @@
 # GNUnet should not put more than a few of MB there.
 #
 # Default is GNUNET_HOME       = ~/.gnunet
-GNUNET_HOME    = ~/.gnunet
+# GNUNET_HOME  = ~/.gnunet
 
 
 ###############################################

Modified: GNUnet/doc/man/Makefile.am
===================================================================
--- GNUnet/doc/man/Makefile.am  2005-04-30 09:18:08 UTC (rev 711)
+++ GNUnet/doc/man/Makefile.am  2005-05-01 11:53:45 UTC (rev 712)
@@ -19,7 +19,8 @@
 gnunet-unindex.1 \
 gnunet-update.1 \
 gnunetd.1 \
-gnunet.conf.5
+gnunet.conf.5 \
+gnunetd.conf.5
 
 EXTRA_DIST = $(man_MANS) \
  gnunet-download-manager.1
\ No newline at end of file

Modified: GNUnet/doc/man/gnunet-man-template
===================================================================
--- GNUnet/doc/man/gnunet-man-template  2005-04-30 09:18:08 UTC (rev 711)
+++ GNUnet/doc/man/gnunet-man-template  2005-05-01 11:53:45 UTC (rev 712)
@@ -26,18 +26,9 @@
 ~/.gnunet/.hostkey
 Nodes GNUnet RSA private key
 .TP
-~/.gnunet/data/hosts/
-Hostkeys
-.TP
-~/.gnunet/data/content/
-Content directory
-.TP
-~/.gnunet/data/credit/
-Credit Directory
-.TP
 ~/.gnunet/database*
 Database files
 .SH "REPORTING BUGS"
-Report bugs by using mantis <https://gnunet.org/mantis/> or by sending 
electronic mail to <address@hidden>
+Report bugs by using mantis <https://gnunet.org/mantis/> or by sending 
electronic mail to <address@hidden>
 .SH "SEE ALSO"
 \fBgnunet\-gtk\fP(1), \fBgnunet\-insert\fP(1), \fBgnunet\-search\fP(1), 
\fBgnunet\-download\fP(1), \fBgnunet.conf\fP(5), \fBgnunetd\fP(1)

Modified: GNUnet/doc/man/gnunet-peer-info.1
===================================================================
--- GNUnet/doc/man/gnunet-peer-info.1   2005-04-30 09:18:08 UTC (rev 711)
+++ GNUnet/doc/man/gnunet-peer-info.1   2005-05-01 11:53:45 UTC (rev 712)
@@ -1,33 +1,33 @@
-.TH GNUNET-PEER-INFO 1 "April 20, 2004" "GNUnet"
+.TH GNUNET-PEER-INFO 1 "April 30, 2005" "GNUnet"
 
 .SH NAME
-gnunet-peer-info \- Display information about other known nodes.
+gnunet\-peer\-info \- Display information about other known nodes.
 
 .SH SYNOPSIS
-.B gnunet-peer-info
+.B gnunet\-peer\-info
 .RI [ options ]
 .br
 
 .SH DESCRIPTION
 .PP
-\fBgnunet-peer-info\fP display the last known IP and GNUnet host address of 
known nodes.
+\fBgnunet\-peer\-info\fP display the last known IP and GNUnet host address of 
known nodes.
 
 .SH OPTIONS
 .B
-.IP -h, --help
+.IP \-h, \-\-help
 Print help page
 .B
-.IP -c FILENAME, --config=FILENAME
+.IP \-c FILENAME, \-\-config=FILENAME
 Load config file (default: /etc/gnunet.conf)
 .B
-.IP -v, --version
+.IP \-v, \-\-version
 Print the version number
 .B
-.IP -L LOGLEVEL, --loglelvel=LOGLEVEL
+.IP \-L LOGLEVEL, \-\-loglelvel=LOGLEVEL
 Set the loglevel
 
 .SH BUGS
-Report bugs by using mantis <https://gnunet.org/mantis/> or by sending 
electronic mail to <address@hidden>
+Report bugs by using mantis <https://gnunet.org/mantis/> or by sending 
electronic mail to <address@hidden>
 
 .SH SEE ALSO
-gnunet.conf(5), gnunetd(1)
+gnunetd.conf(5), gnunetd(1)

Modified: GNUnet/doc/man/gnunet-transport-check.1
===================================================================
--- GNUnet/doc/man/gnunet-transport-check.1     2005-04-30 09:18:08 UTC (rev 
711)
+++ GNUnet/doc/man/gnunet-transport-check.1     2005-05-01 11:53:45 UTC (rev 
712)
@@ -1,15 +1,15 @@
-.TH GNUNET-TRANSPORT-CHECK "1" "19 Dec 2003" "GNUnet"
+.TH GNUNET-TRANSPORT-CHECK "1" "30 Apr 2005" "GNUnet"
 .SH NAME
-gnunet-transport-check \- a tool to test a GNUnet transport service
+gnunet\-transport\-check \- a tool to test a GNUnet transport service
 .SH SYNOPSIS
 .B gnunet\-transport\-check
 [\fIOPTIONS\fR]
 .SH DESCRIPTION
 .PP
-gnunet-transport-check can be used to test or profile
+gnunet\-transport\-check can be used to test or profile
 a GNUnet transport service.  The tool can be used to test
 both the correctness of the software as well as the correctness
-of the configuration.  gnunet-transport-check features two modes,
+of the configuration.  gnunet\-transport\-check features two modes,
 called loopback mode and ping mode.  In loopback mode the test is limited to 
testing if the
 transport can be used to communicate with itself (loopback).
 This mode does not include communication with other peers which
@@ -23,27 +23,27 @@
 normal that some peers do not respond, but if no peer responds something
 is likely to be wrong.  The configuration is always taken
 from the configuration file.  Do not run gnunetd while running
-gnunet-transport-check since the transport services cannot
+gnunet\-transport\-check since the transport services cannot
 be used by two processes at the same time.
 .PP
-gnunet-transport-check will always produce an error-message for
-the NAT transport in loopback mode.  If NAT is configured in accept-mode (as 
in,
+gnunet\-transport\-check will always produce an error\-message for
+the NAT transport in loopback mode.  If NAT is configured in accept\-mode (as 
in,
 accept connections from peers using network address translation),
 the check will fail with the message "could not create HELO",
 which is correct since the peer itself is clearly not going to
-advertise itself as a NAT.  If the peer is configured in NAT-mode,
+advertise itself as a NAT.  If the peer is configured in NAT\-mode,
 that is, the peer is behind a NAT box, the message will be
 'could not connect'.  For NAT, both messages are NOT errors
 but exactly what is supposed to happen.
 .PP
-Similarly, a NAT-ed peer should typically configure the TCP transport
+Similarly, a NAT\-ed peer should typically configure the TCP transport
 to use port 0 (not listen on any port).  In this case,
-gnunet-transport-check will print 'could not create HELO' for the
+gnunet\-transport\-check will print 'could not create HELO' for the
 TCP transport.  This is also ok.  In fact, a correctly configured
 peer using NAT should give just two errors (could not connect for
 tcp and could not create HELO for NAT) when tested using
-gnunet-transport-check.  The reason is, that gnunet-transport-check
-only tests loopback connectivity, and for a NAT-ed peer, that just
+gnunet\-transport\-check.  The reason is, that gnunet\-transport\-check
+only tests loopback connectivity, and for a NAT\-ed peer, that just
 does not apply.
 .PP
 Note that in ping mode the HTTP download times out after 5 minutes,
@@ -89,4 +89,4 @@
 .SH "REPORTING BUGS"
 Report bugs by using mantis <https://gnunet.org/mantis/> or by sending 
electronic mail to <address@hidden>
 .SH "SEE ALSO"
-\fBgnunet.conf\fP(5), \fBgnunetd\fP(1)
+\fBgnunetd.conf\fP(5), \fBgnunetd\fP(1)

Modified: GNUnet/doc/man/gnunet.conf.5
===================================================================
--- GNUnet/doc/man/gnunet.conf.5        2005-04-30 09:18:08 UTC (rev 711)
+++ GNUnet/doc/man/gnunet.conf.5        2005-05-01 11:53:45 UTC (rev 712)
@@ -1,23 +1,22 @@
-.TH GNUNET.CONF "5" "10 Dec 2003" "GNUnet"
+.TH GNUNET.CONF "5" "30 Apr 2005" "GNUnet"
 .SH NAME
-gnunet.conf \- GNUnet configuration file
+gnunet.conf \- GNUnet client configuration file
 .SH SYNOPSIS
-~/.gnunet/gnunet.conf and /etc/gnunet.conf
+~/.gnunet/gnunet.conf
 .SH DESCRIPTION
 .PP
-GNUnet uses two configuation files.  /etc/gnunet.conf is the default location 
for the configuration file used by gnunetd, the GNUnet daemon.  It contains the 
network and resource configuration for the peer.  A template can be found in 
contrib/gnunet.root.  The RPM installs the template to /etc/gnunet.conf.
+GNUnet uses two configuation files, one for user interfaces (gnunet.conf) and 
one for the server (gnunetd) and associated administrative tools.  This man 
page describes the configuration file for the clients.
+.PP
+~/.gnunet/gnunet.conf is the default location for the configuration file used 
by the gnunet clients (such as gnunet\-gtk, gnunet\-insert, gnunet\-search, 
etc.).  When any of the clients is started for the first time by a user, a 
default configuration file will be written to ~/.gnunet/gnunet.conf (if that 
file does not yet exist).  The defaults should work immediately for most users.
 .TP
-Another configuration file is used to allow users to customize GNUnet 
according to their needs.  It is used by all of the GNUnet tools and the 
default location is ~/.gnunet/gnunet.conf.  The user configuration allows the 
specification of personal options, such as the nickname in the chat.  A 
template can be found in contrib/gnunet.user.  The RPM installs a template for 
this file in /etc/skel/.gnunet/gnunet.conf.
+The configuration file is used to allow users to customize GNUnet according to 
their needs.  The user configuration allows the specification of personal 
options, such as the nickname in the chat. 
 .TP
-Both configuration files use the same basic syntax.  The file is split into 
sections.  Every section begins with [SECTIONNAME] and contains a number of 
options of the form OPTION=VALUE.  Empty lines and lines beginning with a # are 
treated as comments.  Some options are optional, in particular certain sections 
are not used at all unless the corresponding service module is loaded (e.g. you 
do not have to configure the SMTP transport unless you decide to use it).
+The basic structure of the configuration file is the following.  The file is 
split into sections.  Every section begins with [SECTIONNAME] and contains a 
number of options of the form OPTION=VALUE.  Empty lines and lines beginning 
with a # are treated as comments.  Almost all options are optional and the 
tools resort to reasonable defaults if they are not present.
 .SH FILES
 .TP
-/etc/gnunet.conf
-gnunetd configuration file
-.TP
 ~/.gnunet/gnunet.conf
-GNUnet user configuration file
+GNUnet client (per local user) configuration file
 .SH "REPORTING BUGS"
 Report bugs by using mantis <https://gnunet.org/mantis/> or by sending 
electronic mail to <address@hidden>
 .SH "SEE ALSO"
-\fBgnunet\-gtk\fP(1), \fBgnunet\-insert\fP(1), \fBgnunet\-search\fP(1), 
\fBgnunet\-download\fP(1), \fBgnunet.conf\fP(5), \fBgnunetd\fP(1)
+\fBgnunet\-gtk\fP(1), \fBgnunet\-insert\fP(1), \fBgnunet\-search\fP(1), 
\fBgnunet\-download\fP(1), \fBgnunetd.conf\fP(5), \fBgnunetd\fP(1)

Modified: GNUnet/doc/man/gnunetd.1
===================================================================
--- GNUnet/doc/man/gnunetd.1    2005-04-30 09:18:08 UTC (rev 711)
+++ GNUnet/doc/man/gnunetd.1    2005-05-01 11:53:45 UTC (rev 712)
@@ -48,4 +48,4 @@
 .SH "REPORTING BUGS"
 Report bugs by using mantis <https://gnunet.org/mantis/> or by sending 
electronic mail to <address@hidden>
 .SH "SEE ALSO"
-\fBgnunet\-gtk\fP(1), \fBgnunet\-insert\fP(1), \fBgnunet\-search\fP(1), 
\fBgnunet\-download\fP(1), \fBgnunet.conf\fP(5), \fBgnunetd\fP(1)
+\fBgnunet\-gtk\fP(1), \fBgnunet\-insert\fP(1), \fBgnunet\-search\fP(1), 
\fBgnunet\-download\fP(1), \fBgnunetd.conf\fP(5), \fBgnunetd\fP(1)

Modified: GNUnet/mkinstalldirs
===================================================================
--- GNUnet/mkinstalldirs        2005-04-30 09:18:08 UTC (rev 711)
+++ GNUnet/mkinstalldirs        2005-05-01 11:53:45 UTC (rev 712)
@@ -1,20 +1,32 @@
 #! /bin/sh
 # mkinstalldirs --- make directory hierarchy
-# Author: Noah Friedman <address@hidden>
+
+scriptversion=2004-02-15.20
+
+# Original author: Noah Friedman <address@hidden>
 # Created: 1993-05-16
-# Public domain
+# Public domain.
+#
+# This file is maintained in Automake, please report
+# bugs to <address@hidden> or send patches to
+# <address@hidden>.
 
 errstatus=0
 dirmode=""
 
 usage="\
-Usage: mkinstalldirs [-h] [--help] [-m mode] dir ..."
+Usage: mkinstalldirs [-h] [--help] [--version] [-m MODE] DIR ...
 
+Create each directory DIR (with mode MODE, if specified), including all
+leading file name components.
+
+Report bugs to <address@hidden>."
+
 # process command line arguments
 while test $# -gt 0 ; do
   case $1 in
     -h | --help | --h*)         # -h for help
-      echo "$usage" 1>&2
+      echo "$usage"
       exit 0
       ;;
     -m)                         # -m PERM arg
@@ -23,6 +35,10 @@
       dirmode=$1
       shift
       ;;
+    --version)
+      echo "$0 $scriptversion"
+      exit 0
+      ;;
     --)                         # stop option processing
       shift
       break
@@ -50,17 +66,37 @@
   0) exit 0 ;;
 esac
 
+# Solaris 8's mkdir -p isn't thread-safe.  If you mkdir -p a/b and
+# mkdir -p a/c at the same time, both will detect that a is missing,
+# one will create a, then the other will try to create a and die with
+# a "File exists" error.  This is a problem when calling mkinstalldirs
+# from a parallel make.  We use --version in the probe to restrict
+# ourselves to GNU mkdir, which is thread-safe.
 case $dirmode in
   '')
-    if mkdir -p -- . 2>/dev/null; then
+    if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then
       echo "mkdir -p -- $*"
       exec mkdir -p -- "$@"
+    else
+      # On NextStep and OpenStep, the `mkdir' command does not
+      # recognize any option.  It will interpret all options as
+      # directories to create, and then abort because `.' already
+      # exists.
+      test -d ./-p && rmdir ./-p
+      test -d ./--version && rmdir ./--version
     fi
     ;;
   *)
-    if mkdir -m "$dirmode" -p -- . 2>/dev/null; then
+    if mkdir -m "$dirmode" -p --version . >/dev/null 2>&1 &&
+       test ! -d ./--version; then
       echo "mkdir -m $dirmode -p -- $*"
       exec mkdir -m "$dirmode" -p -- "$@"
+    else
+      # Clean up after NextStep and OpenStep mkdir.
+      for d in ./-m ./-p ./--version "./$dirmode";
+      do
+        test -d $d && rmdir $d
+      done
     fi
     ;;
 esac
@@ -84,17 +120,17 @@
       mkdir "$pathcomp" || lasterr=$?
 
       if test ! -d "$pathcomp"; then
-       errstatus=$lasterr
+       errstatus=$lasterr
       else
-       if test ! -z "$dirmode"; then
+       if test ! -z "$dirmode"; then
          echo "chmod $dirmode $pathcomp"
-         lasterr=""
-         chmod "$dirmode" "$pathcomp" || lasterr=$?
+         lasterr=""
+         chmod "$dirmode" "$pathcomp" || lasterr=$?
 
-         if test ! -z "$lasterr"; then
-           errstatus=$lasterr
-         fi
-       fi
+         if test ! -z "$lasterr"; then
+           errstatus=$lasterr
+         fi
+       fi
       fi
     fi
 
@@ -107,5 +143,8 @@
 # Local Variables:
 # mode: shell-script
 # sh-indentation: 2
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-end: "$"
 # End:
-# mkinstalldirs ends here

Modified: GNUnet/src/applications/fs/ecrs/upload.c
===================================================================
--- GNUnet/src/applications/fs/ecrs/upload.c    2005-04-30 09:18:08 UTC (rev 
711)
+++ GNUnet/src/applications/fs/ecrs/upload.c    2005-05-01 11:53:45 UTC (rev 
712)
@@ -161,7 +161,9 @@
     return SYSERR;
   }
   if (0 == assertIsFile(filename)) {
-    BREAK();
+    LOG(LOG_ERROR,
+       "'%s' is not a file.\n",
+       filename);
     return SYSERR;
   }
   sock = getClientSocket();

Modified: GNUnet/src/applications/topology_f2f/topology.c
===================================================================
--- GNUnet/src/applications/topology_f2f/topology.c     2005-04-30 09:18:08 UTC 
(rev 711)
+++ GNUnet/src/applications/topology_f2f/topology.c     2005-05-01 11:53:45 UTC 
(rev 712)
@@ -265,6 +265,76 @@
   return saturation;
 }
 
+static int rereadConfiguration() {
+  char * tmp;
+  char * fn;
+  char * data;
+  size_t size;
+  size_t pos;
+  EncName enc;
+  HashCode512 hc;
+
+  GROW(friends,
+       friendCount,
+       0);
+  tmp = getConfigurationString("F2F",
+                              "FRIENDS");
+  if (tmp == NULL) {
+    LOG(LOG_ERROR,
+       _("Need to have list of friends in configuration under '%s' in section 
'%s'.\n"),
+       "FRIENDS",
+       "F2F");
+    return SYSERR;
+  }
+  fn = expandFileName(tmp);
+  FREE(tmp);
+  if (0 == assertIsFile(fn)) {
+    FREE(fn);
+    return SYSERR;
+  }
+  size = getFileSize(fn);
+  data = MALLOC(size);
+  if (size != readFile(fn, size, data)) {
+    LOG(LOG_ERROR,
+       _("Failed to read friends list from '%s'\n"),
+       fn);
+    FREE(fn);
+    return SYSERR;
+  }
+  FREE(fn);
+  pos = 0;
+  while ( (pos < size) && 
+         isspace(data[pos])) 
+    pos++;
+  while (pos <= size - sizeof(EncName)) {
+    memcpy(&enc,
+          &data[pos],
+          sizeof(EncName));
+    if (! isspace(enc.encoding[sizeof(EncName)-1])) {
+      LOG(LOG_WARNING,
+         _("Syntax error in topology specification, skipping bytes.\n"));
+      continue;
+    }
+    enc.encoding[sizeof(EncName)-1] = '\0';
+    if (OK == enc2hash((char*)&enc,
+                      &hc)) {
+      GROW(friends,
+          friendCount,
+          friendCount+1);
+      friends[friendCount-1].hashPubKey = hc;
+    } else {
+      LOG(LOG_WARNING,
+         _("Syntax error in topology specification, skipping bytes '%s'.\n"),
+         &enc);
+    }
+    pos = pos + sizeof(EncName);
+    while ( (pos < size) && 
+           isspace(data[pos])) 
+      pos++;
+  }
+  return OK;
+}
+
 Topology_ServiceAPI *
 provide_module_topology_f2f(CoreAPIForApplication * capi) {
   static Topology_ServiceAPI api;
@@ -303,13 +373,23 @@
     return NULL;
   }
 
+  if (SYSERR == rereadConfiguration()) {
+    capi->releaseService(identity);
+    identity = NULL;
+    capi->releaseService(transport);
+    transport = NULL;
+    capi->releaseService(session);
+    session = NULL;
+    capi->releaseService(pingpong);
+    pingpong = NULL;
+    return NULL;
+  }
+  registerConfigurationUpdateCallback
+    ((NotifyConfigurationUpdateCallback)&rereadConfiguration);
   addCronJob(&cronCheckLiveness,
             5 * cronSECONDS,
             5 * cronSECONDS,
             NULL);
-
-  /* FIXME: initialize 'friends' from configuration! */
-
   api.estimateNetworkSize = &estimateNetworkSize;
   api.getSaturation = &estimateSaturation;
   api.allowConnectionFrom = &allowConnection;
@@ -320,6 +400,8 @@
   delCronJob(&cronCheckLiveness,
             5 * cronSECONDS,
             NULL);
+  unregisterConfigurationUpdateCallback
+    ((NotifyConfigurationUpdateCallback)&rereadConfiguration);
   coreAPI->releaseService(identity);
   identity = NULL;
   coreAPI->releaseService(transport);

Modified: GNUnet/src/include/gnunet_util.h
===================================================================
--- GNUnet/src/include/gnunet_util.h    2005-04-30 09:18:08 UTC (rev 711)
+++ GNUnet/src/include/gnunet_util.h    2005-05-01 11:53:45 UTC (rev 712)
@@ -114,6 +114,8 @@
  */
 #define DEFAULT_CLIENT_CONFIG_FILE "~/.gnunet/gnunet.conf"
 #define DEFAULT_DAEMON_CONFIG_FILE "/etc/gnunet.conf"
+#define VAR_DAEMON_CONFIG_FILE "/var/lib/GNUnet/gnunet.conf"
+#define HOME_DAEMON_CONFIG_FILE "~/.gnunet/gnunet.root"
 
 /**
  * @brief Length of RSA encrypted data (2048 bit)

Modified: GNUnet/src/server/gnunet-peer-info.c
===================================================================
--- GNUnet/src/server/gnunet-peer-info.c        2005-04-30 09:18:08 UTC (rev 
711)
+++ GNUnet/src/server/gnunet-peer-info.c        2005-05-01 11:53:45 UTC (rev 
712)
@@ -171,6 +171,9 @@
 int main(int argc, char *argv[]) {
   if (OK != initUtil(argc, argv, &parser))
     return SYSERR;
+  FREENONNULL(setConfigurationString("TCPSERVER",
+                                    "DISABLE",
+                                    "YES"));
   initCore();
   identity = requestService("identity");
   transport = requestService("transport");

Modified: GNUnet/src/server/tcpserver.c
===================================================================
--- GNUnet/src/server/tcpserver.c       2005-04-30 09:18:08 UTC (rev 711)
+++ GNUnet/src/server/tcpserver.c       2005-05-01 11:53:45 UTC (rev 712)
@@ -703,6 +703,10 @@
 
   MUTEX_CREATE_RECURSIVE(&handlerlock);
   MUTEX_CREATE_RECURSIVE(&clientlock);
+  if (testConfigurationString("TCPSERVER",
+                             "DISABLE",
+                             "YES"))
+    return OK;
   tcpserver_keep_running = YES;
   serverSignal = SEMAPHORE_NEW(0);
   if (0 == PTHREAD_CREATE(&TCPLISTENER_listener_,
@@ -744,6 +748,10 @@
     PTHREAD_JOIN(&TCPLISTENER_listener_, &unused);
     return OK;
   } else {
+    if (testConfigurationString("TCPSERVER",
+                               "DISABLE",
+                               "YES"))
+      return OK;
     return SYSERR;
   }
 }

Modified: GNUnet/src/util/configuration.c
===================================================================
--- GNUnet/src/util/configuration.c     2005-04-30 09:18:08 UTC (rev 711)
+++ GNUnet/src/util/configuration.c     2005-05-01 11:53:45 UTC (rev 712)
@@ -412,12 +412,24 @@
                                "_MAGIC_",
                                "YES")) {
       expCfgName = getenv("GNUNETD_CONFIG");
-      if (expCfgName == NULL)
-       expCfgName = DEFAULT_DAEMON_CONFIG_FILE;
+      if (expCfgName == NULL) {
+       /* pick default, but try to pick it so
+          that we can write there (if it does not
+          exist) */
+       expCfgName = "/etc/gnunetd.conf";
+       if ( access(expCfgName, R_OK) &&
+            access("/etc", X_OK) ) {
+         expCfgName = "/var/lib/GNUnet/gnunetd.conf";
+         if ( access(expCfgName, R_OK) &&
+              access("/var/lib/GNUnet", X_OK)) {
+           expCfgName = "~/.gnunet/gnunetd.conf";
+         }
+       }         
+      }
     } else {
       expCfgName = getenv("GNUNET_CONFIG");
       if (expCfgName == NULL)
-       expCfgName = DEFAULT_CLIENT_CONFIG_FILE;
+       expCfgName = "~/.gnunet/gnunet.conf";
     }
     expCfgName = expandFileName(expCfgName);
     setConfigurationString("FILES",
@@ -441,7 +453,8 @@
     FREE(c);
     /* try generating a configuration file */
     LOG(LOG_WARNING,
-       _("Configuration file '%s' not found. I will try to create the default 
configuration file at that location.\n"),
+       _("Configuration file '%s' not found. "
+         "I will try to create the default configuration file at that 
location.\n"),
        expCfgName);
     f = FOPEN(expCfgName,
              "a+");

Modified: GNUnet/src/util/generate
===================================================================
--- GNUnet/src/util/generate    2005-04-30 09:18:08 UTC (rev 711)
+++ GNUnet/src/util/generate    2005-05-01 11:53:45 UTC (rev 712)
@@ -3,7 +3,15 @@
 # that ASCII file (converts " to \" and puts
 # fprintf and a function around the file).
 echo "#include <stdio.h>"
+echo "#include <unistd.h>"
 echo "void " $2 "(FILE * f) {"
+if [ $2 = 'generate_gnunetd_conf' ]
+then
+ echo " if (access(\"/var/lib/GNUnet\", X_OK))";
+ echo "  fprintf(f, \"  GNUNET_HOME = ~/.gnunet\");";
+ echo " else";
+ echo "  fprintf(f, \"  GNUNET_HOME = /var/lib/GNUnet\");";
+fi
 cat $1 | sed \
         -e "s/\"/\\\\\"/g" \
        -e "s/^/ fprintf(f, \"%s\\\\n\",\"/" \

Modified: GNUnet/todo
===================================================================
--- GNUnet/todo 2005-04-30 09:18:08 UTC (rev 711)
+++ GNUnet/todo 2005-05-01 11:53:45 UTC (rev 712)
@@ -1,12 +1,9 @@
 0.7.0 [6'05?] (aka "compatibility? what's that?"):
-- gnunet-insert crashes if called with invalid filename?
-- gnunet-peer-info does not work if gnunetd is running
 - Features removed but to be revived:
   * gnunet-gtk
 - Missing Features:
   * resolve "FIXME 0.7"
   * fsui core (persistence) [ difficult ]
-  * read 'friends' list for topology_f2f
   * #593 (gnunet-setup)
   * #770? (use freedback (LOG) in gnunet-gtk via show-messages)
 - Additional (automated, make check-style) testing:
@@ -20,7 +17,6 @@
     + URI tracking
 - Documentation:
   * ECRS block format changes (dramatic!)
-  * gnunet-directory (no more categories) and gnunet-pseudonym (no passwords)
   * Hacking GNUnet
 
 0.7.x (aka "stabilization"):
@@ -39,6 +35,7 @@
 - #678 (directory browser)
 - Documentation:
   * LJ article
+- support using -k multiple times in gnunet-pseudonym
 
 1.0.0 (aka "userfriendly"):
 - implement testbed for profiling





reply via email to

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