1
0
Fork 0
mirror of https://github.com/warmcat/libwebsockets.git synced 2025-03-09 00:00:04 +01:00

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>
This commit is contained in:
Andy Green 2012-06-04 08:53:26 +08:00
parent 1f680abb7d
commit 5513fe0577

View file

@ -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) {