aboutsummaryrefslogtreecommitdiffstats
path: root/lib/inets/src/http_client
diff options
context:
space:
mode:
authorIngela Anderton Andin <[email protected]>2015-06-15 11:30:43 +0200
committerIngela Anderton Andin <[email protected]>2015-06-16 09:46:03 +0200
commitcdadd193deb6e46c5a244b5fc3aabc3a89f92055 (patch)
tree6cc5566ca226b9391a4ec046ebd12552352dcac2 /lib/inets/src/http_client
parent77d02ff81a4b7c0ea5f26b4e83097902556bef83 (diff)
downloadotp-cdadd193deb6e46c5a244b5fc3aabc3a89f92055.tar.gz
otp-cdadd193deb6e46c5a244b5fc3aabc3a89f92055.tar.bz2
otp-cdadd193deb6e46c5a244b5fc3aabc3a89f92055.zip
inets: Fix race condition in httpc
If the socket is closed by the peer do not try to close it again. Solves OTP-11845
Diffstat (limited to 'lib/inets/src/http_client')
-rw-r--r--lib/inets/src/http_client/httpc_handler.erl2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/inets/src/http_client/httpc_handler.erl b/lib/inets/src/http_client/httpc_handler.erl
index a4971cec0f..ce9a0e3d26 100644
--- a/lib/inets/src/http_client/httpc_handler.erl
+++ b/lib/inets/src/http_client/httpc_handler.erl
@@ -1390,6 +1390,8 @@ case_insensitive_header(Str) ->
activate_once(#session{socket = Socket, socket_type = SocketType}) ->
http_transport:setopts(SocketType, Socket, [{active, once}]).
+close_socket(#session{socket = {remote_close,_}}) ->
+ ok;
close_socket(#session{socket = Socket, socket_type = SocketType}) ->
http_transport:close(SocketType, Socket).