jlouis / etorrent

Erlang Bittorrent Client
BSD 2-Clause "Simplified" License
294 stars 50 forks source link

Refactor etorrent_peer_recv to minimize state passing #79

Closed edwardw closed 13 years ago

edwardw commented 13 years ago

Hi,

I've refactor-ed module etorrent_peer_recv to eliminate unnecessary state passing between functions. make eunit and make dialyze are all good. And in one test run, it also successfully started to downloading one torrent file.

Please review my change.

Regards, Edward

jlouis commented 13 years ago

See the comment on L148. It generates some warnings, but is harmless for the code apparently due to the survivability of Erlang :)

edwardw commented 13 years ago

I also tried to refactor etorrent_peer_control a little bit. Please take a look. In the meantime, I will move on to other issues / enhancements.

jlouis commented 13 years ago

Cool, taking a look later today

jlouis commented 13 years ago

Also pulled to next. I plan a move to master later when it has been tested a bit.