From 37c33cf03d5874e336c3c98f7c3c931171a99fc6 Mon Sep 17 00:00:00 2001 From: Jesper Louis Andersen Date: Fri, 4 Jul 2008 22:34:44 +0200 Subject: [PATCH] When choking a peer don't store the last chunk in its local piece cache. Cuts down memory usage by *a* *lot*. --- lib/etorrent-1.0/src/etorrent_t_peer_send.erl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/etorrent-1.0/src/etorrent_t_peer_send.erl b/lib/etorrent-1.0/src/etorrent_t_peer_send.erl index 4276139..c317992 100644 --- a/lib/etorrent-1.0/src/etorrent_t_peer_send.erl +++ b/lib/etorrent-1.0/src/etorrent_t_peer_send.erl @@ -160,7 +160,7 @@ handle_info(Msg, S) -> handle_cast(choke, S) when S#state.choke == true -> {noreply, S, 0}; handle_cast(choke, S) when S#state.choke == false -> - send_message(choke, S#state{choke = true}); + send_message(choke, S#state{choke = true, piece_cache = none}); handle_cast(unchoke, S) when S#state.choke == false -> {noreply, S, 0}; handle_cast(unchoke, S) when S#state.choke == true -> -- 2.11.4.GIT