aboutsummaryrefslogtreecommitdiff
path: root/src/nse
diff options
context:
space:
mode:
authorSree Harsha Totakura <totakura@in.tum.de>2013-03-26 10:59:44 +0000
committerSree Harsha Totakura <totakura@in.tum.de>2013-03-26 10:59:44 +0000
commit4fec0b51eb45106fe3a24d1e59df915cdf027e86 (patch)
tree8a843390387c3817046b0d2e5bc1d7d870c5600f /src/nse
parentfcd8cd22ee2c843b86cc945062ebbeb49f6030a2 (diff)
downloadgnunet-4fec0b51eb45106fe3a24d1e59df915cdf027e86.tar.gz
gnunet-4fec0b51eb45106fe3a24d1e59df915cdf027e86.zip
- generate histograms with unique file names
Diffstat (limited to 'src/nse')
-rw-r--r--src/nse/gnunet-service-nse.c17
-rw-r--r--src/nse/nse.conf.in5
2 files changed, 19 insertions, 3 deletions
diff --git a/src/nse/gnunet-service-nse.c b/src/nse/gnunet-service-nse.c
index 9ba4063da..43f358a81 100644
--- a/src/nse/gnunet-service-nse.c
+++ b/src/nse/gnunet-service-nse.c
@@ -1452,9 +1452,22 @@ key_generation_cb (void *cls,
1452 } 1452 }
1453#if ENABLE_HISTOGRAM 1453#if ENABLE_HISTOGRAM
1454 if (GNUNET_OK == 1454 if (GNUNET_OK ==
1455 GNUNET_CONFIGURATION_get_value_filename (cfg, "NSE", "HISTOGRAM", &proof)) 1455 GNUNET_CONFIGURATION_get_value_filename (cfg, "NSE", "HISTOGRAM_DIR", &proof))
1456 { 1456 {
1457 wh = GNUNET_BIO_write_open (proof); 1457 char *hostname;
1458 char *hgram_file;
1459
1460 hostname = GNUNET_malloc (GNUNET_OS_get_hostname_max_length ());
1461 if (0 == gethostname (hostname, HOST_NAME_MAX))
1462 {
1463 (void) GNUNET_asprintf (&hgram_file, "%s/%s_%jd.hist",
1464 proof, hostname, (intmax_t) getpid);
1465 wh = GNUNET_BIO_write_open (hgram_file);
1466 GNUNET_free (hgram_file);
1467 }
1468 else
1469 GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "gethostname");
1470 GNUNET_free (hostname);
1458 GNUNET_free (proof); 1471 GNUNET_free (proof);
1459 } 1472 }
1460#endif 1473#endif
diff --git a/src/nse/nse.conf.in b/src/nse/nse.conf.in
index 374617fa8..84bbef5c5 100644
--- a/src/nse/nse.conf.in
+++ b/src/nse/nse.conf.in
@@ -10,7 +10,10 @@ UNIXPATH = /tmp/test-nse-service-nse.unix
10UNIX_MATCH_UID = NO 10UNIX_MATCH_UID = NO
11UNIX_MATCH_GID = YES 11UNIX_MATCH_GID = YES
12PROOFFILE = $SERVICEHOME/.nse-proof 12PROOFFILE = $SERVICEHOME/.nse-proof
13HISTOGRAM = $SERVICEHOME/nse-history.log 13
14# The directory where the NSE services logs timestamps everytime a size estime
15# flooding message is received
16HISTOGRAM_DIR = $SERVICEHOME
14 17
15# How 'slowly' should the proof-of-work be constructed (delay 18# How 'slowly' should the proof-of-work be constructed (delay
16# between rounds); sane values between 0 and ~1000. 19# between rounds); sane values between 0 and ~1000.