diff options
author | Andy Green <andy.green@linaro.org> | 2012-06-04 08:53:26 +0800 |
---|---|---|
committer | Andy Green <andy.green@linaro.org> | 2012-06-04 08:53:26 +0800 |
commit | 5513fe0577a588f3efb35d621741e835539b474a (patch) | |
tree | 9bd3a5debe9cfe2c2d433ebfeaa1e1389a4316ac | |
parent | 1f680abb7da6994ed7073d52fca2dadc103e5fe4 (diff) |
add missing sa_data init to canonical hostname code
Shay noticed we're no longer initializing the initial lookup of
server canonical hostname correctly
Reported-by: Shay Zuker <shay@boxee.tv>
Signed-off-by: Andy Green <andy.green@linaro.org>
-rw-r--r-- | lib/libwebsockets.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/libwebsockets.c b/lib/libwebsockets.c index 4c19a15..6f93778 100644 --- a/lib/libwebsockets.c +++ b/lib/libwebsockets.c @@ -2594,9 +2594,10 @@ libwebsocket_create_context(int port, const char *interf, n = 0; if (strlen(hostname) < sizeof(sa.sa_data) - 1) { + strcpy(sa.sa_data, hostname); // fprintf(stderr, "my host name is %s\n", sa.sa_data); - n = getnameinfo(&sa, sizeof(sa), hostname, (sizeof hostname) - 1, - NULL, 0, 0); + n = getnameinfo(&sa, sizeof(sa), hostname, + (sizeof hostname) - 1, NULL, 0, 0); } if (!n) { |