mirror of
https://github.com/ninenines/cowboy.git
synced 2025-07-14 20:30:23 +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() ->
|
||||
{ok, Interfaces} = inet:getiflist(),
|
||||
[LocalInterface | _] = lists:filter(fun
|
||||
("lo" ++ _) -> true;
|
||||
(_) -> false
|
||||
[LocalInterface | _ ] = lists:filter(fun(Interface) ->
|
||||
{ok, [{flags, Flags}]} = inet:ifget(Interface, [flags]),
|
||||
lists:member(loopback, Flags)
|
||||
end, Interfaces),
|
||||
{ok, [{mtu, MTU}]} = inet:ifget(LocalInterface, [mtu]),
|
||||
MTU.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue