Log errors that happen when retrieving http headers in ejabberd_http

It seems that ssl errors can be generated here, so lets have abily to show
them instead of swallowing them silently.
This commit is contained in:
Paweł Chmielowski 2020-04-07 13:49:50 +02:00
parent e01e528235
commit 16585713f8
1 changed files with 4 additions and 1 deletions

View File

@ -193,7 +193,10 @@ receive_headers(#state{trail = Trail} = State) ->
Socket = State#state.socket,
Data = SockMod:recv(Socket, 0, 300000),
case Data of
{error, _} -> ok;
{error, Error} ->
?DEBUG("Error when retrieving http headers ~p: ~p",
[State#state.sockmod, Error]),
ok;
{ok, D} ->
parse_headers(State#state{trail = <<Trail/binary, D/binary>>})
end.