From d09d7d45f8af4748f5f6c0429b13214a7092c9b6 Mon Sep 17 00:00:00 2001 From: Andy Green Date: Thu, 31 Jan 2013 10:05:43 +0800 Subject: [PATCH] get error from getnameinfo if unable to improve hostname and use hostname Signed-off-by: Andy Green --- lib/libwebsockets.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/libwebsockets.c b/lib/libwebsockets.c index cfe6b446..75302d0d 100644 --- a/lib/libwebsockets.c +++ b/lib/libwebsockets.c @@ -1619,9 +1619,9 @@ libwebsocket_create_context(int port, const char *interf, if (strlen(hostname) < sizeof(sa.sa_data) - 1) { strcpy(sa.sa_data, hostname); - // lwsl_debug("my host name is %s\n", sa.sa_data); + lwsl_debug("my host name is %s\n", sa.sa_data); n = getnameinfo(&sa, sizeof(sa), hostname, - (sizeof hostname) - 1, NULL, 0, 0); + (sizeof hostname) - 1, NULL, 0, NI_NAMEREQD); } if (!n) {