From 561b34bd73152deb756821d280c24899b378db2a Mon Sep 17 00:00:00 2001 From: Filipe David Manana Date: Wed, 5 Jan 2011 17:37:53 +0000 Subject: [PATCH] Don't send req_timedout error if there's socket data in the message queue --- src/ibrowse_http_client.erl | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/ibrowse_http_client.erl b/src/ibrowse_http_client.erl index ea75948..b343238 100644 --- a/src/ibrowse_http_client.erl +++ b/src/ibrowse_http_client.erl @@ -236,10 +236,17 @@ handle_info({req_timedout, From}, State) -> end; handle_info(timeout, State) -> - do_trace("Inactivity timeout triggered. Shutting down connection~n", []), - shutting_down(State), - do_error_reply(State, req_timedout), - {stop, normal, State}; + receive + {tcp, _Sock, Data} -> + handle_sock_data(Data, State); + {ssl, _Sock, Data} -> + handle_sock_data(Data, State) + after 0 -> + do_trace("Inactivity timeout triggered. Shutting down connection~n", []), + shutting_down(State), + do_error_reply(State, req_timedout), + {stop, normal, State} + end; handle_info({trace, Bool}, State) -> put(my_trace_flag, Bool),