choice of the best OR connection
connection_or_get_by_identity_digest() returns a correct best connection of type OR; at most cases. (if no other problems with other parts of code)
But checks not generalize enough. As example: Let Tor has two (or more) non-obsolete connections with the same digest and one of them is non-canonical and newest (self present at orconn_identity_map). While other conditions the same, function returns those non-canonical connection from orconn_identity_map even if oldest connections (also non-obsolete) is canonical.
This situation with several not marked for close non-obsolete connections was hypothetical but it's happened.
here a version of fix
--- connection_or.original.c Sat Jul 26 22:36:20 2008 +++ connection_or.c Tue Aug 19 09:38:30 2008 @@ -480,6 +480,8 @@ continue; /* We never prefer obsolete over non-obsolete connections. */
/* We prefer canonical connections: */
(!best->is_canonical && conn->is_canonical) || /* We prefer non-obsolete connections: */ (best->_base.or_is_obsolete && !conn->_base.or_is_obsolete) || /* If both have circuits we prefer the newer: */
[Automatically added by flyspray2trac: Operating System: All]