summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2006-04-25 07:31:16 +0000
committerRoger Dingledine <arma@torproject.org>2006-04-25 07:31:16 +0000
commitb172270bcb57a0546057966e45b633bc4119cce4 (patch)
treea8c3d8c03de5e3ccc0ac3db15df0a0cd7ddab6ef /src
parent312beb994020d32cece89c94078b72ad796cd208 (diff)
downloadtor-b172270bcb57a0546057966e45b633bc4119cce4.tar.gz
tor-b172270bcb57a0546057966e45b633bc4119cce4.zip
do some backporting. bug 285 is not yet backported.
svn:r6423
Diffstat (limited to 'src')
-rw-r--r--src/or/cpuworker.c7
-rw-r--r--src/or/hibernate.c5
-rw-r--r--src/or/main.c2
-rw-r--r--src/or/router.c11
4 files changed, 13 insertions, 12 deletions
diff --git a/src/or/cpuworker.c b/src/or/cpuworker.c
index 1e57c93316..badca3563e 100644
--- a/src/or/cpuworker.c
+++ b/src/or/cpuworker.c
@@ -396,8 +396,11 @@ process_pending_task(connection_t *cpuworker)
log_warn(LD_OR,"assign_to_cpuworker failed. Ignoring.");
}
-/** How long do we let a cpuworker work before deciding that it's wedged? */
-#define CPUWORKER_BUSY_TIMEOUT (60*60)
+/** How long should we let a cpuworker stay busy before we give
+ * up on it and decide that we have a bug or infinite loop?
+ * This value is high because some servers with low memory/cpu
+ * sometimes spend an hour or more swapping, and Tor starves. */
+#define CPUWORKER_BUSY_TIMEOUT (60*60*12)
/** We have a bug that I can't find. Sometimes, very rarely, cpuworkers get
* stuck in the 'busy' state, even though the cpuworker process thinks of
diff --git a/src/or/hibernate.c b/src/or/hibernate.c
index 1c734a96ea..da74e98dd2 100644
--- a/src/or/hibernate.c
+++ b/src/or/hibernate.c
@@ -862,9 +862,10 @@ consider_hibernation(time_t now)
"Bandwidth soft limit reached; commencing hibernation.");
hibernate_begin(HIBERNATE_STATE_LOWBANDWIDTH, now);
} else if (accounting_enabled && now < interval_wakeup_time) {
- format_iso_time(buf,interval_wakeup_time);
+ format_local_iso_time(buf,interval_wakeup_time);
log_notice(LD_ACCT,
- "Commencing hibernation. We will wake up at %s GMT", buf);
+ "Commencing hibernation. We will wake up at %s local time.",
+ buf);
hibernate_go_dormant(now);
}
}
diff --git a/src/or/main.c b/src/or/main.c
index 47342ac389..fa65aad7ce 100644
--- a/src/or/main.c
+++ b/src/or/main.c
@@ -1349,7 +1349,7 @@ dumpstats(int severity)
if (!connection_is_listener(conn)) {
log(severity,LD_GENERAL,
"Conn %d is to '%s:%d'.", i,
- escaped_safe_str(conn->address), conn->port);
+ safe_str(conn->address), conn->port);
log(severity,LD_GENERAL,
"Conn %d: %d bytes waiting on inbuf (len %d, last read %d secs ago)",
i,
diff --git a/src/or/router.c b/src/or/router.c
index 16174acdc7..7cd7255b67 100644
--- a/src/or/router.c
+++ b/src/or/router.c
@@ -760,10 +760,9 @@ router_get_my_routerinfo(void)
if (!server_mode(get_options()))
return NULL;
- if (!desc_routerinfo) {
- if (router_rebuild_descriptor(1))
+ if (!desc_routerinfo || !desc_clean_since)
+ if (router_rebuild_descriptor(!desc_routerinfo))
return NULL;
- }
return desc_routerinfo;
}
@@ -774,10 +773,8 @@ const char *
router_get_my_descriptor(void)
{
const char *body;
- if (!desc_routerinfo) {
- if (router_rebuild_descriptor(1))
- return NULL;
- }
+ if (!router_get_my_routerinfo())
+ return NULL;
body = signed_descriptor_get_body(&desc_routerinfo->cache_info);
log_debug(LD_GENERAL,"my desc is '%s'", body);
return body;