From cdadd193deb6e46c5a244b5fc3aabc3a89f92055 Mon Sep 17 00:00:00 2001 From: Ingela Anderton Andin Date: Mon, 15 Jun 2015 11:30:43 +0200 Subject: inets: Fix race condition in httpc If the socket is closed by the peer do not try to close it again. Solves OTP-11845 --- lib/inets/src/http_client/httpc_handler.erl | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lib/inets/src/http_client') 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). -- cgit v1.2.3