| 41 |
41 |
| 42 #ifdef __cplusplus |
42 #ifdef __cplusplus |
| 43 extern "C" { |
43 extern "C" { |
| 44 #endif |
44 #endif |
| 45 |
45 |
| |
46 #define WS_LOCATION_NMATCH 16 |
| |
47 |
| 46 typedef struct WSLocation WSLocation; |
48 typedef struct WSLocation WSLocation; |
| 47 typedef struct WSLocationConfig WSLocationConfig; |
49 typedef struct WSLocationConfig WSLocationConfig; |
| 48 |
50 |
| 49 typedef enum WSLocationMatch { |
51 typedef enum WSLocationMatch { |
| 50 WS_LOCATION_MATCH_EXACT = 0, |
52 WS_LOCATION_MATCH_EXACT = 0, |
| 52 WS_LOCATION_MATCH_CS_REGEX, |
54 WS_LOCATION_MATCH_CS_REGEX, |
| 53 WS_LOCATION_MATCH_CI_REGEX |
55 WS_LOCATION_MATCH_CI_REGEX |
| 54 } WSLocationMatch; |
56 } WSLocationMatch; |
| 55 |
57 |
| 56 struct WSLocationConfig { |
58 struct WSLocationConfig { |
| |
59 /* |
| |
60 * location regex match results |
| |
61 */ |
| |
62 regmatch_t match[WS_LOCATION_NMATCH]; |
| |
63 |
| 57 /* |
64 /* |
| 58 * Activate dirindex setting |
65 * Activate dirindex setting |
| 59 */ |
66 */ |
| 60 WSBool set_dirindex; |
67 WSBool set_dirindex; |
| 61 |
68 |
| 144 }; |
151 }; |
| 145 |
152 |
| 146 WSLocation* cfg_location_get(ServerConfiguration *cfg, ConfigNode *obj); |
153 WSLocation* cfg_location_get(ServerConfiguration *cfg, ConfigNode *obj); |
| 147 |
154 |
| 148 int location_apply_config(WSLocationConfig *target, WSLocation *loc); |
155 int location_apply_config(WSLocationConfig *target, WSLocation *loc); |
| 149 int location_match(WSLocation *loc, cxstring uri); |
156 int location_match(WSLocation *loc, cxstring uri, regmatch_t *match); |
| 150 WSLocationConfig* location_match_and_get_config(pool_handle_t *pool, cxstring uri, WSLocation *loc); |
157 WSLocationConfig* location_match_and_get_config(pool_handle_t *pool, cxstring uri, WSLocation *loc); |
| 151 WSLocationConfig* cfg_location_match(Session *sn, Request *rq); |
158 WSLocationConfig* cfg_location_match(Session *sn, Request *rq); |
| 152 |
159 |
| 153 #ifdef __cplusplus |
160 #ifdef __cplusplus |
| 154 } |
161 } |