We need the iomgr_init for winsocks initialization.

Also fixed (thanks @nicolasnoble) wrong construction of error msg.
pull/3726/head
David Garcia Quintas 9 years ago
parent 706b70f498
commit 661ad7fc85
  1. 5
      src/core/iomgr/resolve_address_windows.c
  2. 2
      test/core/iomgr/resolve_address_test.c

@ -48,6 +48,7 @@
#include <grpc/support/alloc.h>
#include <grpc/support/host_port.h>
#include <grpc/support/log.h>
#include <grpc/support/log_win32.h>
#include <grpc/support/string_util.h>
#include <grpc/support/thd.h>
#include <grpc/support/time.h>
@ -94,7 +95,9 @@ grpc_resolved_addresses *grpc_blocking_resolve_address(
s = getaddrinfo(host, port, &hints, &result);
GRPC_SCHEDULING_END_BLOCKING_REGION;
if (s != 0) {
gpr_log(GPR_ERROR, "getaddrinfo: %s", gai_strerror(s));
char *error_message = gpr_format_message(s);
gpr_log(GPR_ERROR, "getaddrinfo: %s", error_message);
gpr_free(error_message);
goto done;
}

@ -126,6 +126,7 @@ static void test_unparseable_hostports(void) {
int main(int argc, char **argv) {
grpc_test_init(argc, argv);
grpc_executor_init();
grpc_iomgr_init();
test_localhost();
test_default_port();
test_missing_default_port();
@ -133,6 +134,7 @@ int main(int argc, char **argv) {
test_ipv6_without_port();
test_invalid_ip_addresses();
test_unparseable_hostports();
grpc_iomgr_shutdown();
grpc_executor_shutdown();
return 0;
}

Loading…
Cancel
Save