gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r3164 - GNUnet/src/server


From: grothoff
Subject: [GNUnet-SVN] r3164 - GNUnet/src/server
Date: Sat, 29 Jul 2006 15:11:40 -0700 (PDT)

Author: grothoff
Date: 2006-07-29 15:11:39 -0700 (Sat, 29 Jul 2006)
New Revision: 3164

Modified:
   GNUnet/src/server/Makefile.am
   GNUnet/src/server/connection.c
   GNUnet/src/server/gnunet-peer-info.c
   GNUnet/src/server/gnunetd.c
Log:
gnunetd compiles

Modified: GNUnet/src/server/Makefile.am
===================================================================
--- GNUnet/src/server/Makefile.am       2006-07-29 22:09:41 UTC (rev 3163)
+++ GNUnet/src/server/Makefile.am       2006-07-29 22:11:39 UTC (rev 3164)
@@ -18,14 +18,19 @@
  startup.c startup.h \
  version.c version.h
 libgnunetcore_la_LIBADD = \
- $(top_builddir)/src/util/libgnunetutil.la 
+ $(top_builddir)/src/util/libgnunetutil.la \
+ $(top_builddir)/src/util/crypto/libgnunetutil_crypto.la \
+ $(top_builddir)/src/util/cron/libgnunetutil_cron.la 
 
+
 gnunetd_SOURCES = \
  gnunetd.c 
 gnunetd_LDADD = \
- $(top_builddir)/src/util/libgnunetutil.la \
- $(top_builddir)/src/server/libgnunetcore.la
+ $(top_builddir)/src/server/libgnunetcore.la \
+ $(top_builddir)/src/util/loggers/libgnunetutil_logging.la \
+ $(top_builddir)/src/util/config_impl/libgnunetutil_config.la 
 
+
 gnunet_update_SOURCES = \
  gnunet-update.c 
 gnunet_update_LDADD = \

Modified: GNUnet/src/server/connection.c
===================================================================
--- GNUnet/src/server/connection.c      2006-07-29 22:09:41 UTC (rev 3163)
+++ GNUnet/src/server/connection.c      2006-07-29 22:11:39 UTC (rev 3164)
@@ -2619,15 +2619,26 @@
  * limits may now be different.  Adjust the connection table
  * accordingly.
  */
-static void connectionConfigChangeCallback() {
+static int connectionConfigChangeCallback(void * ctx,
+                                         struct GC_Configuration * cfg, 
+                                         struct GE_Context * ectx,
+                                         const char * section,
+                                         const char * option) {
   unsigned long long new_max_bpm;
   unsigned int i;
 
+  if (0 != strcmp(section, "LOAD"))
+    return OK; /* fast path */
+  if (-1 == GC_get_configuration_value_number(cfg,
+                                             "LOAD",
+                                             "MAXNETDOWNBPSTOTAL",
+                                             0,
+                                             ((unsigned long long)-1)/60,
+                                             50000, /* default: 50 kbps */
+                                             &new_max_bpm))
+    return SYSERR;
   MUTEX_LOCK(lock);
-  /* max_bpm may change... */
-  new_max_bpm = 60 * getConfigurationInt("LOAD", "MAXNETDOWNBPSTOTAL");
-  if(new_max_bpm == 0)
-    new_max_bpm = 50000 * 60;   /* assume 50 kbps */
+  new_max_bpm = 60 * new_max_bpm;
   if(max_bpm != new_max_bpm) {
     unsigned int newMAXHOSTS = 0;
 
@@ -2646,8 +2657,12 @@
 
       olen = CONNECTION_MAX_HOSTS_;
       CONNECTION_MAX_HOSTS_ = newMAXHOSTS;
-      setConfigurationInt("gnunetd",
-                          "connection-max-hosts", CONNECTION_MAX_HOSTS_);
+      GE_BREAK(ectx,
+              0 == GC_set_configuration_value_number(cfg,
+                                                     ectx,
+                                                     "gnunetd",
+                                                     "connection-max-hosts",
+                                                     CONNECTION_MAX_HOSTS_));
       newBuffer =
         (BufferEntry **) MALLOC(sizeof(BufferEntry *) * newMAXHOSTS);
       for(i = 0; i < CONNECTION_MAX_HOSTS_; i++)
@@ -2678,9 +2693,12 @@
 
     }
   }
-  disable_random_padding = testConfigurationString("GNUNETD-EXPERIMENTAL",
-                                                   "PADDING", "NO");
+  disable_random_padding = GC_get_configuration_value_yesno(cfg,
+                                                           
"GNUNETD-EXPERIMENTAL",
+                                                           "PADDING",
+                                                           NO);
   MUTEX_UNLOCK(lock);
+  return OK;
 }
 
 /**
@@ -2700,9 +2718,10 @@
   scl_nextHead = NULL;
   scl_nextTail = NULL;
   lock = MUTEX_CREATE(YES);
-  registerConfigurationUpdateCallback(&connectionConfigChangeCallback);
+  GC_attach_change_listener(cfg,
+                           &connectionConfigChangeCallback,
+                           NULL);
   CONNECTION_MAX_HOSTS_ = 0;
-  connectionConfigChangeCallback();
   registerp2pHandler(P2P_PROTO_hangup, &handleHANGUP);
   cron_add_job(cron,
               &cronDecreaseLiveness,
@@ -2764,7 +2783,9 @@
 
   ENTRY();
   transport->stop();
-  unregisterConfigurationUpdateCallback(&connectionConfigChangeCallback);
+  GC_detach_change_listener(cfg,
+                           &connectionConfigChangeCallback,
+                           NULL);
   cron_del_job(cron,
               &cronDecreaseLiveness,
               1 * cronSECONDS,

Modified: GNUnet/src/server/gnunet-peer-info.c
===================================================================
--- GNUnet/src/server/gnunet-peer-info.c        2006-07-29 22:09:41 UTC (rev 
3163)
+++ GNUnet/src/server/gnunet-peer-info.c        2006-07-29 22:11:39 UTC (rev 
3164)
@@ -1,6 +1,6 @@
 /*
      This file is part of GNUnet.
-     (C) 2001, 2002, 2003, 2004 Christian Grothoff (and other contributing 
authors)
+     (C) 2001, 2002, 2003, 2004, 2006 Christian Grothoff (and other 
contributing authors)
 
      GNUnet is free software; you can redistribute it and/or modify
      it under the terms of the GNU General Public License as published
@@ -146,7 +146,7 @@
     return;
   }
   if (SYSERR == verifySig(&helo->senderIdentity,
-                         P2P_hello_MESSAGE_size(helo) - sizeof(Signature) - 
sizeof(PublicKey) - sizeof(P2P_MESSAGE_HEADER),
+                         P2P_hello_MESSAGE_size(helo) - sizeof(Signature) - 
sizeof(PublicKey) - sizeof(MESSAGE_HEADER),
                          &helo->signature,
                          &helo->publicKey)) {
     LOG(LOG_WARNING,

Modified: GNUnet/src/server/gnunetd.c
===================================================================
--- GNUnet/src/server/gnunetd.c 2006-07-29 22:09:41 UTC (rev 3163)
+++ GNUnet/src/server/gnunetd.c 2006-07-29 22:11:39 UTC (rev 3164)
@@ -158,7 +158,8 @@
   COMMAND_LINE_OPTION_HELP(gettext_noop("Starts the gnunetd daemon.")), /* -h 
*/
   COMMAND_LINE_OPTION_HOSTNAME, /* -H */
   COMMAND_LINE_OPTION_LOGGING, /* -L */
-  { 'p', "padding", "PADDING", gettext_noop(""), 1,
+  { 'p', "padding-disable", "YES/NO", 
+    gettext_noop("disable padding with random data (experimental)"), 0,
     &gnunet_getopt_configure_set_option, "GNUNETD-EXPERIMENTAL:PADDING" },
 #ifndef MINGW
   { 'u', "user", "USERNAME", gettext_noop(""), 1, 





reply via email to

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