diff options
author | Sree Harsha Totakura <totakura@in.tum.de> | 2013-03-26 10:59:44 +0000 |
---|---|---|
committer | Sree Harsha Totakura <totakura@in.tum.de> | 2013-03-26 10:59:44 +0000 |
commit | 4fec0b51eb45106fe3a24d1e59df915cdf027e86 (patch) | |
tree | 8a843390387c3817046b0d2e5bc1d7d870c5600f /src/nse | |
parent | fcd8cd22ee2c843b86cc945062ebbeb49f6030a2 (diff) | |
download | gnunet-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.c | 17 | ||||
-rw-r--r-- | src/nse/nse.conf.in | 5 |
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 | |||
10 | UNIX_MATCH_UID = NO | 10 | UNIX_MATCH_UID = NO |
11 | UNIX_MATCH_GID = YES | 11 | UNIX_MATCH_GID = YES |
12 | PROOFFILE = $SERVICEHOME/.nse-proof | 12 | PROOFFILE = $SERVICEHOME/.nse-proof |
13 | HISTOGRAM = $SERVICEHOME/nse-history.log | 13 | |
14 | # The directory where the NSE services logs timestamps everytime a size estime | ||
15 | # flooding message is received | ||
16 | HISTOGRAM_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. |