[or-cvs] whoops, avoid printing a null string sometimes

arma at seul.org arma at seul.org
Mon Aug 22 22:58:40 UTC 2005


Update of /home2/or/cvsroot/tor/src/or
In directory moria:/home/arma/work/onion/cvs/tor/src/or

Modified Files:
	circuitbuild.c 
Log Message:
whoops, avoid printing a null string sometimes


Index: circuitbuild.c
===================================================================
RCS file: /home2/or/cvsroot/tor/src/or/circuitbuild.c,v
retrieving revision 1.136
retrieving revision 1.137
diff -u -d -r1.136 -r1.137
--- circuitbuild.c	22 Aug 2005 05:46:02 -0000	1.136
+++ circuitbuild.c	22 Aug 2005 22:58:38 -0000	1.137
@@ -535,13 +535,16 @@
         log(LOG_NOTICE,"Tor has successfully opened a circuit. Looks like it's working.");
         if (server_mode(options) && !check_whether_orport_reachable()) {
           char dirbuf[128];
-          if (options->DirPort)
-            tor_snprintf(dirbuf, sizeof(dirbuf), " and DirPort %s:%d ",
-                         options->Address, options->DirPort);
-          log(LOG_NOTICE,"Now checking whether ORPort %s:%d%s%s reachable... (this may take several minutes)",
-                 options->Address, options->ORPort,
-                 options->DirPort ? dirbuf : "",
-                 options->DirPort ? "are" : "is");
+          routerinfo_t *me = router_get_my_routerinfo();
+          if (me) {
+            if (me->dir_port)
+              tor_snprintf(dirbuf, sizeof(dirbuf), " and DirPort %s:%d",
+                           me->address, me->dir_port);
+            log(LOG_NOTICE,"Now checking whether ORPort %s:%d%s %s reachable... (this may take several minutes)",
+                   me->address, me->or_port,
+                   me->dir_port ? dirbuf : "",
+                   me->dir_port ? "are" : "is");
+          }
         }
       }
       circuit_rep_hist_note_result(circ);



More information about the tor-commits mailing list