diff --git a/Server/config.c b/Server/config.c index c70847a..1104a03 100644 --- a/Server/config.c +++ b/Server/config.c @@ -16,7 +16,7 @@ struct tw_config config; struct tw_config_entry* tw_vhost_match(const char* name, int port) { int i; for(i = 0; i < config.vhost_count; i++) { - if(strcmp(config.vhosts[i].name, name) == 0 && config.vhosts[i].port == port) { + if(strcmp(config.vhosts[i].name, name) == 0 && (config.vhosts[i].port == -1 ? 1 : config.vhosts[i].port == port)) { return &config.vhosts[i]; } } @@ -78,7 +78,7 @@ int tw_config_read(const char* path) { current = &config.vhosts[config.vhost_count++]; int i; current->name = cm_strdup(vhost); - current->port = 80; + current->port = -1; for(i = 0; vhost[i] != 0; i++) { if(vhost[i] == ':') { current->name[i] = 0; diff --git a/Server/server.c b/Server/server.c index 9d7d3ff..ef4d475 100644 --- a/Server/server.c +++ b/Server/server.c @@ -127,6 +127,8 @@ unsigned int WINAPI tw_server_pass(void* ptr) { #else void tw_server_pass(int sock, bool ssl, int port) { #endif + char* name = config.hostname; + SSL_CTX* ctx = NULL; SSL* s = NULL; if(ssl) { diff --git a/example.conf b/example.conf index 2d9b0a7..74c4248 100644 --- a/example.conf +++ b/example.conf @@ -7,5 +7,5 @@ ListenSSL 8443 8444 8445 8446 8447 SSLKey key.pem SSLCertificate cert.pem -BeginVirtualHost nishinbsd-ssd:8443 +BeginVirtualHost nishinbsd-ssd EndVirtualHost