Commit d2e8551e authored by Salvador Fandino's avatar Salvador Fandino Committed by Mike Gabriel

Simplify ParseListenOption

Merge code paths. Use GetHostAddress to resolve the target host address instead of inet_aton.
parent 5ea2d901
...@@ -13571,14 +13571,7 @@ int ParseListenOption(int &address) ...@@ -13571,14 +13571,7 @@ int ParseListenOption(int &address)
// on localhost. // on localhost.
// //
if (control -> ProxyMode == proxy_server) if (loopbackBind || (control->ProxyMode == proxy_server)) {
{
address = (int) inet_addr("127.0.0.1");
}
else
{
if ( loopbackBind )
{
address = htonl(INADDR_LOOPBACK); address = htonl(INADDR_LOOPBACK);
} }
else else
...@@ -13586,10 +13579,9 @@ int ParseListenOption(int &address) ...@@ -13586,10 +13579,9 @@ int ParseListenOption(int &address)
address = htonl(INADDR_ANY); address = htonl(INADDR_ANY);
} }
} }
}
else else
{ {
address = inet_addr(listenHost); address = GetHostAddress(listenHost);
} }
return 1; return 1;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment