Changeset 21 in Main for trunk/Server/tw_config.h
- Timestamp:
- Sep 14, 2024, 9:39:39 PM (2 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Server/tw_config.h
r19 r21 4 4 #define __TW_CONFIG_H__ 5 5 6 #include "tw_http.h" 7 6 8 #include <stdint.h> 9 #include <stdbool.h> 7 10 8 #define MAX_PORTS 1024 9 #define MAX_VHOSTS 1024 10 #define MAX_MODULES 1024 11 #ifdef __MINGW32__ 12 #include <winsock2.h> 13 #define NO_IPV6 14 #else 15 #include <netinet/in.h> 16 #endif 17 18 #ifdef NO_IPV6 19 #define SOCKADDR struct sockaddr_in 20 #else 21 #define SOCKADDR struct sockaddr_in6 22 #endif 23 24 #define MAX_PORTS 1024 25 #define MAX_VHOSTS 1024 26 #define MAX_MODULES 1024 27 #define MAX_DIRS 1024 28 #define MAX_MIME 1024 29 30 enum TW_DIR_TYPE { 31 TW_DIR_ALLOW = 0, 32 TW_DIR_DENY 33 }; 34 35 struct tw_dir_entry { 36 char* name; 37 char* dir; 38 int type; 39 }; 40 41 struct tw_mime_entry { 42 char* ext; 43 char* mime; 44 }; 11 45 12 46 struct tw_config_entry { … … 16 50 char* sslcert; 17 51 char* root; 52 struct tw_dir_entry dirs[MAX_DIRS]; 53 int dir_count; 54 struct tw_mime_entry mimes[MAX_DIRS]; 55 int mime_count; 18 56 }; 19 57 … … 33 71 int tw_config_read(const char* path); 34 72 struct tw_config_entry* tw_vhost_match(const char* name, int port); 73 bool tw_permission_allowed(const char* path, SOCKADDR addr, struct tw_http_request req, struct tw_config_entry* vhost); 35 74 36 75 #endif
Note:
See TracChangeset
for help on using the changeset viewer.