[or-cvs] do some backporting. bug 285 is not yet backported.
arma at seul.org
arma at seul.org
Tue Apr 25 07:31:18 UTC 2006
Update of /home/or/cvsroot/tor/src/or
In directory moria:/home/arma/work/onion/tor-011x/tor/src/or
Modified Files:
Tag: tor-0_1_1-patches
cpuworker.c hibernate.c main.c router.c
Log Message:
do some backporting. bug 285 is not yet backported.
Index: cpuworker.c
===================================================================
RCS file: /home/or/cvsroot/tor/src/or/cpuworker.c,v
retrieving revision 1.101
retrieving revision 1.101.2.1
diff -u -p -d -r1.101 -r1.101.2.1
--- cpuworker.c 12 Mar 2006 23:31:16 -0000 1.101
+++ cpuworker.c 25 Apr 2006 07:31:16 -0000 1.101.2.1
@@ -396,8 +396,11 @@ process_pending_task(connection_t *cpuwo
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
Index: hibernate.c
===================================================================
RCS file: /home/or/cvsroot/tor/src/or/hibernate.c,v
retrieving revision 1.70
retrieving revision 1.70.2.1
diff -u -p -d -r1.70 -r1.70.2.1
--- hibernate.c 13 Mar 2006 01:06:55 -0000 1.70
+++ hibernate.c 25 Apr 2006 07:31:16 -0000 1.70.2.1
@@ -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);
}
}
Index: main.c
===================================================================
RCS file: /home/or/cvsroot/tor/src/or/main.c,v
retrieving revision 1.639.2.1
retrieving revision 1.639.2.2
diff -u -p -d -r1.639.2.1 -r1.639.2.2
--- main.c 10 Apr 2006 21:33:32 -0000 1.639.2.1
+++ main.c 25 Apr 2006 07:31:16 -0000 1.639.2.2
@@ -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,
Index: router.c
===================================================================
RCS file: /home/or/cvsroot/tor/src/or/router.c,v
retrieving revision 1.259.2.1
retrieving revision 1.259.2.2
diff -u -p -d -r1.259.2.1 -r1.259.2.2
--- router.c 18 Apr 2006 03:05:34 -0000 1.259.2.1
+++ router.c 25 Apr 2006 07:31:16 -0000 1.259.2.2
@@ -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;
More information about the tor-commits
mailing list