In this situation socket is closed in function: dlhttpc_client:maybe_close_socket/5.
So basically reordering patterns in case expression will solve an issue of trying to close socket twice.
TL;DR
Exception I was getting:
** exception exit: {function_clause,[{tls,close,
[undefined],
[{file,"tls.erl"},{line,262}]},
{dlhttpc_sock,close,2,
[{file,"src/dlhttpc_sock.erl"},{line,178}]},
{dlhttpc_client,execute,10,
[{file,"src/dlhttpc_client.erl"},{line,150}]},
{dlhttpc_client,request,10,
[{file,"src/dlhttpc_client.erl"},{line,84}]}]}
in function dlhttpc:request/9 (src/dlhttpc.erl, line 363)
@ferd hey, another thing that cause an exception.
I am using
{max_connections, bypass}
option.After request server closes connection and sends headers:
In this situation socket is closed in function:
dlhttpc_client:maybe_close_socket/5
. So basically reordering patterns in case expression will solve an issue of trying to close socket twice.TL;DR Exception I was getting: