couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dav...@apache.org
Subject [22/33] ibrowse commit: updated refs/heads/import-master to 1167b0e
Date Wed, 12 Feb 2014 06:21:11 GMT
Fix ibrowse 2.0.x inactivity timeouts not getting cleared.
Patch submitted upstream: http://github.com/cmullaparthi/ibrowse/issues/#issue/17



git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@1030534 13f79535-47bb-0310-9956-ffa450edef68


Project: http://git-wip-us.apache.org/repos/asf/couchdb-ibrowse/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-ibrowse/commit/a284c874
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-ibrowse/tree/a284c874
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-ibrowse/diff/a284c874

Branch: refs/heads/import-master
Commit: a284c874f0c72361dbe7362e8a15a67c969d80a0
Parents: db7f903
Author: Filipe David Borba Manana <fdmanana@apache.org>
Authored: Wed Nov 3 17:03:05 2010 +0000
Committer: Filipe David Borba Manana <fdmanana@apache.org>
Committed: Wed Nov 3 17:03:05 2010 +0000

----------------------------------------------------------------------
 ibrowse_http_client.erl | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-ibrowse/blob/a284c874/ibrowse_http_client.erl
----------------------------------------------------------------------
diff --git a/ibrowse_http_client.erl b/ibrowse_http_client.erl
index 16d9b87..2dd209d 100644
--- a/ibrowse_http_client.erl
+++ b/ibrowse_http_client.erl
@@ -1713,7 +1713,15 @@ set_inac_timer(State) ->
     set_inac_timer(State, get_inac_timeout(State)).
 
 set_inac_timer(_State, Timeout) when is_integer(Timeout) ->
-    erlang:send_after(Timeout, self(), timeout);
+    TimerRef = erlang:send_after(Timeout, self(), timeout),
+    case erlang:put(inac_timer, TimerRef) of
+    OldTimer when is_reference(OldTimer) ->
+        erlang:cancel_timer(OldTimer),
+        receive timeout -> ok after 0 -> ok end;
+    _ ->
+        ok
+    end,
+    TimerRef;
 set_inac_timer(_, _) ->
     undefined.
 


Mime
View raw message