gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r26607 - gnunet/src/nse


From: gnunet
Subject: [GNUnet-SVN] r26607 - gnunet/src/nse
Date: Tue, 26 Mar 2013 11:59:44 +0100

Author: harsha
Date: 2013-03-26 11:59:44 +0100 (Tue, 26 Mar 2013)
New Revision: 26607

Modified:
   gnunet/src/nse/gnunet-service-nse.c
   gnunet/src/nse/nse.conf.in
Log:
- generate histograms with unique file names

Modified: gnunet/src/nse/gnunet-service-nse.c
===================================================================
--- gnunet/src/nse/gnunet-service-nse.c 2013-03-26 10:50:06 UTC (rev 26606)
+++ gnunet/src/nse/gnunet-service-nse.c 2013-03-26 10:59:44 UTC (rev 26607)
@@ -1452,9 +1452,22 @@
   }
 #if ENABLE_HISTOGRAM
   if (GNUNET_OK ==
-      GNUNET_CONFIGURATION_get_value_filename (cfg, "NSE", "HISTOGRAM", 
&proof))
+      GNUNET_CONFIGURATION_get_value_filename (cfg, "NSE", "HISTOGRAM_DIR", 
&proof))
   {
-    wh = GNUNET_BIO_write_open (proof);
+    char *hostname;
+    char *hgram_file;
+
+    hostname = GNUNET_malloc (GNUNET_OS_get_hostname_max_length ());
+    if (0 == gethostname (hostname, HOST_NAME_MAX))
+    {
+      (void) GNUNET_asprintf (&hgram_file, "%s/%s_%jd.hist", 
+                              proof, hostname, (intmax_t) getpid);
+      wh = GNUNET_BIO_write_open (hgram_file);
+      GNUNET_free (hgram_file);
+    }
+    else
+      GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "gethostname");    
+    GNUNET_free (hostname);
     GNUNET_free (proof);
   }
 #endif

Modified: gnunet/src/nse/nse.conf.in
===================================================================
--- gnunet/src/nse/nse.conf.in  2013-03-26 10:50:06 UTC (rev 26606)
+++ gnunet/src/nse/nse.conf.in  2013-03-26 10:59:44 UTC (rev 26607)
@@ -10,8 +10,11 @@
 UNIX_MATCH_UID = NO
 UNIX_MATCH_GID = YES
 PROOFFILE = $SERVICEHOME/.nse-proof
-HISTOGRAM = $SERVICEHOME/nse-history.log
 
+# The directory where the NSE services logs timestamps everytime a size estime
+# flooding message is received
+HISTOGRAM_DIR = $SERVICEHOME
+
 # How 'slowly' should the proof-of-work be constructed (delay
 # between rounds); sane values between 0 and ~1000.
 WORKDELAY = 5 ms




reply via email to

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