[or-cvs] Hack to fix the bug found by Marvin Preuss.
arma at seul.org
arma at seul.org
Fri Feb 3 09:47:15 UTC 2006
Update of /home/or/cvsroot/tor/src/or
In directory moria:/home/arma/work/onion/tor-010x/tor/src/or
Modified Files:
Tag: tor-0_1_0-patches
directory.c main.c router.c
Log Message:
Hack to fix the bug found by Marvin Preuss.
This was already fixed in 0.1.1.9-alpha but never got backported.
This is only a hack because the code has diverged a lot since the
0.1.0 branch. Hopefully it will hold though.
Index: directory.c
===================================================================
RCS file: /home/or/cvsroot/tor/src/or/directory.c,v
retrieving revision 1.230.2.1
retrieving revision 1.230.2.2
diff -u -p -d -r1.230.2.1 -r1.230.2.2
--- directory.c 12 Sep 2005 06:09:06 -0000 1.230.2.1
+++ directory.c 3 Feb 2006 09:47:12 -0000 1.230.2.2
@@ -273,9 +273,11 @@ directory_initiate_command(const char *a
tor_assert(address);
tor_assert(addr);
- tor_assert(dir_port);
tor_assert(digest);
+ if (!dir_port)
+ return;
+
switch (purpose) {
case DIR_PURPOSE_FETCH_DIR:
log_fn(LOG_DEBUG,"initiating directory fetch");
Index: main.c
===================================================================
RCS file: /home/or/cvsroot/tor/src/or/main.c,v
retrieving revision 1.505.2.8
retrieving revision 1.505.2.9
diff -u -p -d -r1.505.2.8 -r1.505.2.9
--- main.c 29 Jan 2006 11:44:18 -0000 1.505.2.8
+++ main.c 3 Feb 2006 09:47:12 -0000 1.505.2.9
@@ -820,7 +820,7 @@ static void second_elapsed_callback(int
if (me && !check_whether_orport_reachable())
log(LOG_WARN,"Your server (%s:%d) has not managed to confirm that its ORPort is reachable. Please check your firewalls, ports, address, etc.",
me->address, me->or_port);
- if (me && !check_whether_dirport_reachable())
+ if (me && me->dir_port && !check_whether_dirport_reachable())
log(LOG_WARN,"Your server (%s:%d) has not managed to confirm that its DirPort is reachable. Please check your firewalls, ports, address, etc.",
me->address, me->dir_port);
}
Index: router.c
===================================================================
RCS file: /home/or/cvsroot/tor/src/or/router.c,v
retrieving revision 1.176.2.9
retrieving revision 1.176.2.10
diff -u -p -d -r1.176.2.9 -r1.176.2.10
--- router.c 1 Dec 2005 02:29:46 -0000 1.176.2.9
+++ router.c 3 Feb 2006 09:47:13 -0000 1.176.2.10
@@ -403,11 +403,9 @@ void consider_testing_reachability(void)
}
if (!check_whether_dirport_reachable()) {
- if (me) {
- directory_initiate_command_router(me, DIR_PURPOSE_FETCH_DIR, 1, NULL, NULL, 0);
- } else {
- log(LOG_NOTICE,"Delaying checking DirPort reachability; can't build descriptor.");
- }
+ if (!me->dir_port)
+ me->dir_port = get_options()->DirPort;
+ directory_initiate_command_router(me, DIR_PURPOSE_FETCH_DIR, 1, NULL, NULL, 0);
}
}
More information about the tor-commits
mailing list