[or-cvs] make connection_or_nonopen_was_started_here() based on some...

arma at seul.org arma at seul.org
Wed Jun 7 07:11:45 UTC 2006


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

Modified Files:
	circuitbuild.c connection_or.c 
Log Message:
make connection_or_nonopen_was_started_here() based on something less
voodooey. it turns out we already do keep a flag like that around.


Index: circuitbuild.c
===================================================================
RCS file: /home2/or/cvsroot/tor/src/or/circuitbuild.c,v
retrieving revision 1.239
retrieving revision 1.240
diff -u -p -d -r1.239 -r1.240
--- circuitbuild.c	6 Jun 2006 03:33:24 -0000	1.239
+++ circuitbuild.c	7 Jun 2006 07:11:42 -0000	1.240
@@ -976,7 +976,7 @@ onionskin_answer(circuit_t *circ, uint8_
   log_debug(LD_CIRC,"Finished sending 'created' cell.");
 
   if (!is_local_IP(circ->p_conn->addr) &&
-      tor_tls_is_server(circ->p_conn->tls)) {
+      !connection_or_nonopen_was_started_here(circ->p_conn)) {
     /* record that we could process create cells from a non-local conn
      * that we didn't initiate; presumably this means that create cells
      * can reach us too. */

Index: connection_or.c
===================================================================
RCS file: /home2/or/cvsroot/tor/src/or/connection_or.c,v
retrieving revision 1.220
retrieving revision 1.221
diff -u -p -d -r1.220 -r1.221
--- connection_or.c	7 Jun 2006 06:21:11 -0000	1.220
+++ connection_or.c	7 Jun 2006 07:11:42 -0000	1.221
@@ -543,11 +543,9 @@ int
 connection_or_nonopen_was_started_here(connection_t *conn)
 {
   tor_assert(conn->type == CONN_TYPE_OR);
-
-  if (tor_digest_is_zero(conn->identity_digest))
-    return 0;
-  else
-    return 1;
+  if (!conn->tls)
+    return 1; /* it's still in proxy states or something */
+  return !tor_tls_is_server(conn->tls);
 }
 
 /** Conn just completed its handshake. Return 0 if all is well, and



More information about the tor-commits mailing list