]> Git repositories of Nishi - tewi.git/commitdiff
better
authorNishi <nishi@nishi.boats>
Fri, 13 Sep 2024 13:38:57 +0000 (13:38 +0000)
committerNishi <nishi@nishi.boats>
Fri, 13 Sep 2024 13:38:57 +0000 (13:38 +0000)
git-svn-id: file:///raid/svn-personal/tewi/trunk@13 8739d7e6-ffea-ec47-b151-bdff447c6205

Server/config.c
Server/server.c
example.conf

index c70847a89b23d213e9f56947f717223625864d89..1104a03a0c4efa96a99ec2c980c8eeefad2dc776 100644 (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;
index 9d7d3ff5d19cc2b04d0d8f8fb4015eec7a66a0d0..ef4d475e9ccd5960b4c1ea542523c12084f47b48 100644 (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) {
index 2d9b0a75167f982db91eb83f67bbc9510ea7ed38..74c4248d26cc827a896dd6907040cf31ddd28100 100644 (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