[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[or-cvs] parameterize RephistTrackTime
Update of /home2/or/cvsroot/tor/src/or
In directory moria:/home/arma/work/onion/cvs/tor/src/or
Modified Files:
config.c main.c or.h rephist.c
Log Message:
parameterize RephistTrackTime
Index: config.c
===================================================================
RCS file: /home2/or/cvsroot/tor/src/or/config.c,v
retrieving revision 1.374
retrieving revision 1.375
diff -u -d -r1.374 -r1.375
--- config.c 23 Jul 2005 01:58:05 -0000 1.374
+++ config.c 25 Jul 2005 10:29:21 -0000 1.375
@@ -163,6 +163,7 @@
VAR("LongLivedPorts", CSV, LongLivedPorts, "21,22,706,1863,5050,5190,5222,5223,6667,8300,8888"),
VAR("PathlenCoinWeight", DOUBLE, PathlenCoinWeight, "0.3"),
VAR("RedirectExit", LINELIST, RedirectExit, NULL),
+ VAR("RephistTrackTime", INTERVAL, RephistTrackTime, "24 hours"),
OBSOLETE("RouterFile"),
VAR("RunAsDaemon", BOOL, RunAsDaemon, "0"),
VAR("RunTesting", BOOL, RunTesting, "0"),
Index: main.c
===================================================================
RCS file: /home2/or/cvsroot/tor/src/or/main.c,v
retrieving revision 1.530
retrieving revision 1.531
diff -u -d -r1.530 -r1.531
--- main.c 23 Jul 2005 01:58:05 -0000 1.530
+++ main.c 25 Jul 2005 10:29:21 -0000 1.531
@@ -709,7 +709,7 @@
}
/* Also, take this chance to remove old information from rephist. */
- rep_history_clean(now-24*60*60);
+ rep_history_clean(now - options->RephistTrackTime);
}
if (time_to_fetch_running_routers < now) {
@@ -873,8 +873,10 @@
current_second = now.tv_sec; /* remember which second it is, for next time */
#if 0
- if (current_second % 60 == 0)
+ if (current_second % 300 == 0) {
+ rep_history_clean(now - options->RephistTrackTime);
dumpmemusage(get_min_log_level()<LOG_INFO ? get_min_log_level() : LOG_INFO);
+ }
#endif
if (evtimer_add(timeout_event, &one_second))
Index: or.h
===================================================================
RCS file: /home2/or/cvsroot/tor/src/or/or.h,v
retrieving revision 1.631
retrieving revision 1.632
diff -u -d -r1.631 -r1.632
--- or.h 23 Jul 2005 01:58:05 -0000 1.631
+++ or.h 25 Jul 2005 10:29:21 -0000 1.632
@@ -1173,6 +1173,7 @@
int UseHelperNodes; /**< Boolean: Do we try to enter from a smallish number
* of fixed nodes? */
int NumHelperNodes; /**< How many helper nodes do we try to establish? */
+ int RephistTrackTime; /**< How many seconds do we keep rephist info? */
} or_options_t;
#define MAX_SOCKS_REPLY_LEN 1024
Index: rephist.c
===================================================================
RCS file: /home2/or/cvsroot/tor/src/or/rephist.c,v
retrieving revision 1.61
retrieving revision 1.62
diff -u -d -r1.61 -r1.62
--- rephist.c 18 Jul 2005 06:09:04 -0000 1.61
+++ rephist.c 25 Jul 2005 10:29:21 -0000 1.62
@@ -290,7 +290,7 @@
unsigned long upt, downt;
routerinfo_t *r;
- rep_history_clean(now-24*60*60);
+ rep_history_clean(now - get_options()->RephistTrackTime);
log(severity, "--------------- Dumping history information:");