mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2025-02-24 06:48:05 +01:00
non-buggy robustness, even
svn:r353
This commit is contained in:
parent
dfdc93eccb
commit
ad917e7788
1 changed files with 4 additions and 2 deletions
|
@ -119,7 +119,7 @@ connection_t *connection_twin_get_by_addr_port(uint32_t addr, uint16_t port) {
|
|||
|
||||
/* first check if it's there exactly */
|
||||
conn = connection_exact_get_by_addr_port(addr,port);
|
||||
if(conn && connection_state_is_open(conn) && !conn->marked_for_close) {
|
||||
if(conn && connection_state_is_open(conn)) {
|
||||
log(LOG_INFO,"connection_twin_get_by_addr_port(): Found exact match.");
|
||||
return conn;
|
||||
}
|
||||
|
@ -133,7 +133,9 @@ connection_t *connection_twin_get_by_addr_port(uint32_t addr, uint16_t port) {
|
|||
for(i=0;i<nfds;i++) {
|
||||
conn = connection_array[i];
|
||||
assert(conn);
|
||||
if(connection_state_is_open(conn) && !crypto_pk_cmp_keys(conn->pkey, router->pkey)) {
|
||||
if(connection_state_is_open(conn) &&
|
||||
!conn->marked_for_close &&
|
||||
!crypto_pk_cmp_keys(conn->pkey, router->pkey)) {
|
||||
log(LOG_INFO,"connection_twin_get_by_addr_port(): Found twin (%s).",conn->address);
|
||||
return conn;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue