Don't log http errors when socket get closed after processing one request

This commit is contained in:
Paweł Chmielowski 2020-07-28 12:18:18 +02:00
parent 2bcd2c38a9
commit d5935fd1ad
1 changed files with 3 additions and 0 deletions

View File

@ -193,6 +193,9 @@ receive_headers(#state{trail = Trail} = State) ->
Socket = State#state.socket,
Data = SockMod:recv(Socket, 0, 300000),
case Data of
{error, closed} when State#state.request_method == undefined ->
% socket closed without receiving anything in it
ok;
{error, Error} ->
?DEBUG("Error when retrieving http headers ~p: ~p",
[State#state.sockmod, Error]),