0
Fork 0
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:
Ali Sabil 2013-06-10 09:53:32 +02:00
parent fdd67b72a3
commit 809dc32339

View file

@ -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.