Commit c0e61687 authored by Max Kellermann's avatar Max Kellermann

listen: fix windows specific code

During the listen_add_host() API transition, the windows code wasn't tested, and several removed arguments are still in use there.
parent 8c3df4cc
...@@ -295,18 +295,21 @@ listen_add_host(const char *hostname, unsigned port, GError **error) ...@@ -295,18 +295,21 @@ listen_add_host(const char *hostname, unsigned port, GError **error)
#else /* WIN32 */ #else /* WIN32 */
const struct hostent *he; const struct hostent *he;
g_debug("binding to address for %s", param->value); g_debug("binding to address for %s", hostname);
he = gethostbyname(param->value); he = gethostbyname(hostname);
if (he == NULL) { if (he == NULL) {
g_set_error(error, listen_quark(), 0, g_set_error(error, listen_quark(), 0,
"Failed to look up host \"%s\"", hostname); "Failed to look up host \"%s\"", hostname);
return false; return false;
} }
if (he->h_addrtype != AF_INET) if (he->h_addrtype != AF_INET) {
g_error("IPv4 address expected for host \"%s\" at line %i", g_set_error(error, listen_quark(), 0,
param->value, param->line); "IPv4 address expected for host \"%s\"",
hostname);
return false;
}
return listen_add_address(AF_INET, he->h_addr, he->h_length, return listen_add_address(AF_INET, he->h_addr, he->h_length,
error); error);
......
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