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:
parent
1f680abb7d
commit
5513fe0577
1 changed files with 3 additions and 2 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Reference in a new issue