summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Cottlehuber <dch@apache.org>2014-01-29 07:29:35 +0100
committerDave Cottlehuber <dch@apache.org>2014-01-29 08:28:34 +0100
commitb35884580436824adc7f250d9adbe857440026d7 (patch)
treee1929fe639d8ca0c05040a0e613490c1d5d31634
parent5c9f9a9f056ca71c516ddd7eb9ab32f8eb01dc12 (diff)
downloadcouchdb-1986-fix-ibrowse-infinite-async-timeout.tar.gz
ibrowse: fix async hang due to infinite timeout1986-fix-ibrowse-infinite-async-timeout
- import upstream timeout fix[1] - addresses COUCHDB-1986 and quite possibly COUCHDB-1874 as well [1]: https://github.com/cmullaparthi/ibrowse/pull/91.patch
-rw-r--r--src/ibrowse/ibrowse_http_client.erl6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/ibrowse/ibrowse_http_client.erl b/src/ibrowse/ibrowse_http_client.erl
index a1cf6eb25..0ba5e97b1 100644
--- a/src/ibrowse/ibrowse_http_client.erl
+++ b/src/ibrowse/ibrowse_http_client.erl
@@ -226,12 +226,12 @@ handle_info({ssl_error, _Sock, Reason}, State) ->
{stop, normal, State};
handle_info({req_timedout, From}, State) ->
- case lists:keymember(From, #request.from, queue:to_list(State#state.reqs)) of
+ case lists:keysearch(From, #request.from, queue:to_list(State#state.reqs)) of
false ->
{noreply, State};
- true ->
+ {value, #request{stream_to = StreamTo, req_id = ReqId}} ->
+ catch StreamTo ! {ibrowse_async_response_timeout, ReqId},
shutting_down(State),
-%% do_error_reply(State, req_timedout),
{stop, normal, State}
end;