[tor-bugs] #24031 [Core Tor/Tor]: Protover.rs could use a better algorithm

Tor Bug Tracker & Wiki blackhole at torproject.org
Mon Mar 19 22:09:55 UTC 2018


#24031: Protover.rs could use a better algorithm
------------------------------------+------------------------------------
 Reporter:  nickm                   |          Owner:  isis
     Type:  defect                  |         Status:  accepted
 Priority:  High                    |      Milestone:  Tor: 0.3.4.x-final
Component:  Core Tor/Tor            |        Version:
 Severity:  Normal                  |     Resolution:
 Keywords:  rust 033-must protover  |  Actual Points:
Parent ID:                          |         Points:  1
 Reviewer:                          |        Sponsor:
------------------------------------+------------------------------------

Comment (by isis):

 Okay, I have an WIP (done actually, but I need to split it nicely into
 commits) implementation in my `bug24031` branch.

 Warning that I uh… also went a bit nuts on refactoring to have actual
 types for different things, moving functions into them as methods, and
 making them more rusty e.g. implementing proper traits like `impl
 std::str::FromStr for ProtoEntry` instead of having stuff like
 `SupportedProtocols::from_proto_entries_string`. The types are much nicer
 however, they really helped me reason about the code, and also I found
 several differences in behaviour to the C (which were due to us not having
 as much type safety as we could, e.g. if something doesn't parse correctly
 into a type, we want to make sure we're treating it the same way as when C
 can't parse it into a `proto_entry_t` or whatever, instead of just saying
 "this is a String" and "this is a HashMap").

 Caveat emptor that even though I found some differences in return
 codes/parsing/etc to the C, I'm still not fully convinced there aren't
 more, and we should definitely do #24265 soon.

--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/24031#comment:8>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online


More information about the tor-bugs mailing list