diff options
author | Salvador Fandino <sfandino@yahoo.com> | 2015-06-02 12:30:49 +0200 |
---|---|---|
committer | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2016-07-04 22:57:00 +0200 |
commit | d2e8551efe6b78a429ed400b37ac8f86b81830ef (patch) | |
tree | 71aca92903baeb231416d5b5105ccd6af0ad04ce | |
parent | 5ea2d901ba96d2d552385db0708c5edb66bb7a98 (diff) | |
download | nx-libs-d2e8551efe6b78a429ed400b37ac8f86b81830ef.tar.gz nx-libs-d2e8551efe6b78a429ed400b37ac8f86b81830ef.tar.bz2 nx-libs-d2e8551efe6b78a429ed400b37ac8f86b81830ef.zip |
Simplify ParseListenOption
Merge code paths.
Use GetHostAddress to resolve the target host address instead of inet_aton.
-rw-r--r-- | nxcomp/Loop.cpp | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/nxcomp/Loop.cpp b/nxcomp/Loop.cpp index 7e8b1ec62..aab5c356d 100644 --- a/nxcomp/Loop.cpp +++ b/nxcomp/Loop.cpp @@ -13571,25 +13571,17 @@ int ParseListenOption(int &address) // on localhost. // - if (control -> ProxyMode == proxy_server) - { - address = (int) inet_addr("127.0.0.1"); + if (loopbackBind || (control->ProxyMode == proxy_server)) { + address = htonl(INADDR_LOOPBACK); } else { - if ( loopbackBind ) - { - address = htonl(INADDR_LOOPBACK); - } - else - { - address = htonl(INADDR_ANY); - } + address = htonl(INADDR_ANY); } } else { - address = inet_addr(listenHost); + address = GetHostAddress(listenHost); } return 1; |