[tor-bugs] #3569 [Core Tor/Tor]: Refactor socks parsing

Tor Bug Tracker & Wiki blackhole at torproject.org
Tue Jun 26 18:10:52 UTC 2018


#3569: Refactor socks parsing
-------------------------------------------------+-------------------------
 Reporter:  nickm                                |          Owner:  rl1987
     Type:  enhancement                          |         Status:
                                                 |  needs_review
 Priority:  Medium                               |      Milestone:  Tor:
                                                 |  0.3.5.x-final
Component:  Core Tor/Tor                         |        Version:
 Severity:  Normal                               |     Resolution:
 Keywords:  tor-client intro trunnel prop229     |  Actual Points:
  refactor code-quality                          |
Parent ID:                                       |         Points:  4
 Reviewer:  nickm                                |        Sponsor:
-------------------------------------------------+-------------------------
Changes (by rl1987):

 * status:  needs_revision => needs_review


Old description:

> The function parse_socks and its interactions wit the functions that call
> it have grown nigh-unmaintainably complex.  Let's replace it with a
> simple, more linear function.  Key points:
>
>   * State should be kept explicitly.  Let's forget this "if the socks
> version is set, we've parsed this much, ..." business.
>   * The function should dispatch first on state, next on anything else.
>   * We should think of a much better interface; the functions that call
> parse_socks have grown way too tricky.

New description:

 The function parse_socks and its interactions with the functions that call
 it have grown nigh-unmaintainably complex.  Let's replace it with a
 simple, more linear function.  Key points:

   * State should be kept explicitly.  Let's forget this "if the socks
 version is set, we've parsed this much, ..." business.
   * The function should dispatch first on state, next on anything else.
   * We should think of a much better interface; the functions that call
 parse_socks have grown way too tricky.

--

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


More information about the tor-bugs mailing list