From 58b276d93a634824f1e16848fb7c860ebb9a331a Mon Sep 17 00:00:00 2001 From: Jesper Louis Andersen Date: Fri, 25 Jul 2008 22:11:53 +0200 Subject: [PATCH] Handle initial recv timeouts gracefully. --- lib/etorrent-1.0/src/etorrent_t_peer_recv.erl | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/etorrent-1.0/src/etorrent_t_peer_recv.erl b/lib/etorrent-1.0/src/etorrent_t_peer_recv.erl index 2f47250..8945a45 100644 --- a/lib/etorrent-1.0/src/etorrent_t_peer_recv.erl +++ b/lib/etorrent-1.0/src/etorrent_t_peer_recv.erl @@ -239,6 +239,9 @@ handle_cast(_Msg, State) -> %% {stop, Reason, State} %% Description: Handling all non call/cast messages %%-------------------------------------------------------------------- +handle_info(timeout, S) when S#state.tcp_socket =:= none -> + %% Haven't started up yet + {noreply, S, 3000}; handle_info(timeout, S) -> case gen_tcp:recv(S#state.tcp_socket, 0, 3000) of {ok, Packet} -> -- 2.11.4.GIT