Refactoring: Make SOCKS server state machine explicitly defined
> * 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.
This was supposed to be done as part of legacy/trac#3569, but wasn't. We should do it anyway.
issue