Skip to content
Snippets Groups Projects
Commit 661ad7fc authored by David Garcia Quintas's avatar David Garcia Quintas
Browse files

We need the iomgr_init for winsocks initialization.

Also fixed (thanks @nicolasnoble) wrong construction of error msg.
parent 706b70f4
No related branches found
No related tags found
No related merge requests found
......@@ -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;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment