diff options
author | Filipe David Borba Manana <fdmanana@apache.org> | 2011-01-07 17:17:18 +0000 |
---|---|---|
committer | Filipe David Borba Manana <fdmanana@apache.org> | 2011-01-07 17:17:18 +0000 |
commit | 2a1f5e8b4a8bf80c632d44b6c81b0d9dfbd55174 (patch) | |
tree | e8494e96c8cbd6c3dfa92319a23dd2e79e3e671c /src/ibrowse/ibrowse_http_client.erl | |
parent | c13fc058e0e38a40d38163c158444e9d9ab4f291 (diff) |
Merged revision 1056395 from trunk
Applied 2 more ibrowse fixes already submitted upstream
https://github.com/cmullaparthi/ibrowse/pull/24
https://github.com/cmullaparthi/ibrowse/pull/25
git-svn-id: https://svn.apache.org/repos/asf/couchdb/branches/1.0.x@1056397 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/ibrowse/ibrowse_http_client.erl')
-rw-r--r-- | src/ibrowse/ibrowse_http_client.erl | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/ibrowse/ibrowse_http_client.erl b/src/ibrowse/ibrowse_http_client.erl index ea759488..5dce321c 100644 --- a/src/ibrowse/ibrowse_http_client.erl +++ b/src/ibrowse/ibrowse_http_client.erl @@ -287,10 +287,14 @@ handle_sock_data(Data, #state{status = get_header}=State) -> {error, _Reason} -> shutting_down(State), {stop, normal, State}; - State_1 -> - active_once(State_1), - State_2 = set_inac_timer(State_1), - {noreply, State_2} + #state{socket = Socket, status = Status, cur_req = CurReq} = State_1 -> + case {Status, CurReq} of + {get_header, #request{caller_controls_socket = true}} -> + do_setopts(Socket, [{active, once}], State_1); + _ -> + active_once(State_1) + end, + {noreply, set_inac_timer(State_1)} end; handle_sock_data(Data, #state{status = get_body, @@ -683,6 +687,7 @@ send_req_1(From, Headers, Method, Body, Options, Timeout, #state{status = Status, socket = Socket} = State) -> + cancel_timer(State#state.inactivity_timer_ref, {eat_message, timeout}), ReqId = make_req_id(), Resp_format = get_value(response_format, Options, list), Caller_socket_options = get_value(socket_options, Options, []), |