From c98fcc81081fc05f9aedf18a29ed6ba7aadaa960 Mon Sep 17 00:00:00 2001 From: Filipe David Manana Date: Sun, 9 Jan 2011 23:21:32 +0000 Subject: [PATCH] Reset inactivity timeout when stream_next is invoked This avoids plenty of connection inactivity timeouts. From a logical point of view, the inactivity timeout should be reset not only only data is received from the socket but also when the client asks for more data. --- src/ibrowse_http_client.erl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ibrowse_http_client.erl b/src/ibrowse_http_client.erl index ea75948..6548e2c 100644 --- a/src/ibrowse_http_client.erl +++ b/src/ibrowse_http_client.erl @@ -188,7 +188,7 @@ handle_info({stream_next, Req_id}, #state{socket = Socket, cur_req = #request{req_id = Req_id}} = State) -> %% io:format("Client process set {active, once}~n", []), do_setopts(Socket, [{active, once}], State), - {noreply, State}; + {noreply, set_inac_timer(State)}; handle_info({stream_next, _Req_id}, State) -> _Cur_req_id = case State#state.cur_req of