mirror of
https://github.com/ninenines/cowboy.git
synced 2025-07-15 04:30:25 +00:00
Improve the detection of localhost interfaces for the HTTP test suite
This commit is contained in:
parent
fdd67b72a3
commit
809dc32339
1 changed files with 3 additions and 3 deletions
|
@ -422,9 +422,9 @@ body_to_chunks(ChunkSize, Body, Acc) ->
|
||||||
|
|
||||||
get_mtu() ->
|
get_mtu() ->
|
||||||
{ok, Interfaces} = inet:getiflist(),
|
{ok, Interfaces} = inet:getiflist(),
|
||||||
[LocalInterface | _] = lists:filter(fun
|
[LocalInterface | _ ] = lists:filter(fun(Interface) ->
|
||||||
("lo" ++ _) -> true;
|
{ok, [{flags, Flags}]} = inet:ifget(Interface, [flags]),
|
||||||
(_) -> false
|
lists:member(loopback, Flags)
|
||||||
end, Interfaces),
|
end, Interfaces),
|
||||||
{ok, [{mtu, MTU}]} = inet:ifget(LocalInterface, [mtu]),
|
{ok, [{mtu, MTU}]} = inet:ifget(LocalInterface, [mtu]),
|
||||||
MTU.
|
MTU.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue