[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r37433 - gnunet/src/rps
From: |
gnunet |
Subject: |
[GNUnet-SVN] r37433 - gnunet/src/rps |
Date: |
Sat, 2 Jul 2016 01:38:35 +0200 |
Author: ch3
Date: 2016-07-02 01:38:35 +0200 (Sat, 02 Jul 2016)
New Revision: 37433
Modified:
gnunet/src/rps/gnunet-service-rps_peers.c
gnunet/src/rps/rps.conf.in
Log:
-rps _peers: add disable option to peer storage
Modified: gnunet/src/rps/gnunet-service-rps_peers.c
===================================================================
--- gnunet/src/rps/gnunet-service-rps_peers.c 2016-07-01 23:38:31 UTC (rev
37432)
+++ gnunet/src/rps/gnunet-service-rps_peers.c 2016-07-01 23:38:35 UTC (rev
37433)
@@ -782,12 +782,28 @@
{
struct GNUNET_DISK_FileHandle *fh;
uint32_t number_written_peers;
+ int ret;
- if (GNUNET_OK !=
- GNUNET_DISK_directory_create_for_file (filename_valid_peers))
+ if (0 == strncmp ("DISABLE", filename_valid_peers, 7))
{
+ return;
+ }
+
+ ret = GNUNET_DISK_directory_create_for_file (filename_valid_peers);
+ if (GNUNET_SYSERR == ret)
+ {
+ LOG (GNUNET_ERROR_TYPE_WARNING,
+ "Not able to create directory for file `%s'\n",
+ filename_valid_peers);
GNUNET_break (0);
}
+ else if (GNUNET_NO == ret)
+ {
+ LOG (GNUNET_ERROR_TYPE_WARNING,
+ "Directory for file `%s' exists but is not writable for us\n",
+ filename_valid_peers);
+ GNUNET_break (0);
+ }
fh = GNUNET_DISK_file_open (filename_valid_peers,
GNUNET_DISK_OPEN_WRITE |
GNUNET_DISK_OPEN_CREATE,
@@ -872,6 +888,11 @@
const char *str_repr;
const struct GNUNET_PeerIdentity *peer;
+ if (0 == strncmp ("DISABLE", filename_valid_peers, 7))
+ {
+ return;
+ }
+
if (GNUNET_OK != GNUNET_DISK_file_test (filename_valid_peers))
{
return;
Modified: gnunet/src/rps/rps.conf.in
===================================================================
--- gnunet/src/rps/rps.conf.in 2016-07-01 23:38:31 UTC (rev 37432)
+++ gnunet/src/rps/rps.conf.in 2016-07-01 23:38:35 UTC (rev 37433)
@@ -16,6 +16,8 @@
# This is the file in which valid peers are stored
FILENAME_VALID_PEERS = $GNUNET_DATA_HOME/rps/valid_peers.txt
+# Disable storage of valid peers
+#FILENAME_VALID_PEERS = DISABLE
# This is the 'estimate' in the beginning.
# This determines the size of the peers we keep in memory
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r37433 - gnunet/src/rps,
gnunet <=