[tor-bugs] #6236 [Core Tor/Tor]: Remove duplicate code between parse_{c, s}method_line
Tor Bug Tracker & Wiki
blackhole at torproject.org
Sat Feb 17 13:07:17 UTC 2018
#6236: Remove duplicate code between parse_{c,s}method_line
-------------------------------------------------+-------------------------
Reporter: asn | Owner: (none)
Type: task | Status: new
Priority: Medium | Milestone: Tor:
| unspecified
Component: Core Tor/Tor | Version:
Severity: Normal | Resolution:
Keywords: tor-client easy refactor duplicate- | Actual Points:
code |
Parent ID: | Points: 1
Reviewer: | Sponsor:
-------------------------------------------------+-------------------------
Comment (by asn):
Replying to [comment:10 fristonio]:
> For this, I was thinking of wrapping up the common functionalities of
the two methods into a single function which can then be used by both of
them to carry on parsing the line. Is this a good way to go or should I
think of some other way to merge them?
Yes indeed fristonio. That's the logic.
Here are the things that I would try to united between those two
functions:
a) method_name parsing and validation
b) addrport parsing and validation
c) `transport_new` and adding it to `mp->transports`.
Try to keep it simple :)
Good luck :)
--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/6236#comment:12>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online
More information about the tor-bugs
mailing list