shadowsocks-go icon indicating copy to clipboard operation
shadowsocks-go copied to clipboard

cmd/shadowsocks-server: code refactor

Open dylanchu opened this issue 6 years ago • 3 comments

Split codes into different files to get clearer interfaces and structures, with only minor modifications.

dylanchu avatar Jul 08 '18 14:07 dylanchu

thanx for your contribute. But have you changed any core logic?

arthurkiller avatar Jul 08 '18 15:07 arthurkiller

no core logic was changed, just some formal parameter changes on specific functions for decoupling, like function run runUDP handleConnection updatePasswd. function updatePasswd was changed into method of type PasswdManager as it is only a series of manipulations on the type.

dylanchu avatar Jul 08 '18 16:07 dylanchu

another consideration is functions in util.go should be small independent tools that don't rely on functions in the other three files. (but in fact still rely on global variables defined in server.go)

dylanchu avatar Jul 08 '18 17:07 dylanchu