git-svn-id: file:///raid/svn-personal/tewi/trunk@13 8739d7e6-ffea-ec47-b151-bdff447c6205
This commit is contained in:
Nishi 2024-09-13 13:38:57 +00:00
parent 448281ee99
commit 3aee1dbd4b
3 changed files with 5 additions and 3 deletions

View File

@ -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;

View File

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

View File

@ -7,5 +7,5 @@ ListenSSL 8443 8444 8445 8446 8447
SSLKey key.pem
SSLCertificate cert.pem
BeginVirtualHost nishinbsd-ssd:8443
BeginVirtualHost nishinbsd-ssd
EndVirtualHost