mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-24 20:33:31 +01:00
make connection_or_nonopen_was_started_here() based on something less
voodooey. it turns out we already do keep a flag like that around. svn:r6560
This commit is contained in:
parent
003561fa64
commit
1e9b35aee3
@ -976,7 +976,7 @@ onionskin_answer(circuit_t *circ, uint8_t cell_type, char *payload, char *keys)
|
|||||||
log_debug(LD_CIRC,"Finished sending 'created' cell.");
|
log_debug(LD_CIRC,"Finished sending 'created' cell.");
|
||||||
|
|
||||||
if (!is_local_IP(circ->p_conn->addr) &&
|
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
|
/* record that we could process create cells from a non-local conn
|
||||||
* that we didn't initiate; presumably this means that create cells
|
* that we didn't initiate; presumably this means that create cells
|
||||||
* can reach us too. */
|
* can reach us too. */
|
||||||
|
@ -543,11 +543,9 @@ int
|
|||||||
connection_or_nonopen_was_started_here(connection_t *conn)
|
connection_or_nonopen_was_started_here(connection_t *conn)
|
||||||
{
|
{
|
||||||
tor_assert(conn->type == CONN_TYPE_OR);
|
tor_assert(conn->type == CONN_TYPE_OR);
|
||||||
|
if (!conn->tls)
|
||||||
if (tor_digest_is_zero(conn->identity_digest))
|
return 1; /* it's still in proxy states or something */
|
||||||
return 0;
|
return !tor_tls_is_server(conn->tls);
|
||||||
else
|
|
||||||
return 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Conn just completed its handshake. Return 0 if all is well, and
|
/** Conn just completed its handshake. Return 0 if all is well, and
|
||||||
|
Loading…
Reference in New Issue
Block a user