commit - 0ab65593e21482c53ece36aa954204d7b202d351
commit + ce79c944bcbc49b1874e6207a0546a4297571dfc
blob - 50329cf18d0e714f84c77f3d01c4e70062019967
blob + f96e0a349e8077d1491a6b78ef484b73c821ffd1
--- server.c
+++ server.c
}
servname = tls_conn_servername(c->ctx);
- if (servname == NULL)
- goto hostnotfound;
for (h = hosts; h->domain != NULL; ++h) {
- if (!strcmp(h->domain, servname) || !strcmp(h->domain, "*"))
+ if (!strcmp(h->domain, "*"))
break;
+
+ if (servname != NULL && !strcmp(h->domain, servname))
+ break;
}
if (h->domain != NULL) {
return;
}
-hostnotfound:
if (servname != NULL)
strncpy(c->req, servname, sizeof(c->req));
else
strncpy(c->req, "null", sizeof(c->req));
- /* XXX: check the correct response */
if (!start_reply(fds, c, BAD_REQUEST, "Wrong host or missing SNI"))
return;
goodbye(fds, c);