| 103 log_ereport(LOG_FAILURE, "Location directive must have 0-2 args"); |
103 log_ereport(LOG_FAILURE, "Location directive must have 0-2 args"); |
| 104 return NULL; |
104 return NULL; |
| 105 } |
105 } |
| 106 |
106 |
| 107 WSLocation *location = cxZalloc(a, sizeof(WSLocation)); |
107 WSLocation *location = cxZalloc(a, sizeof(WSLocation)); |
| |
108 location->match = match; |
| 108 location->match_string = cx_strdup_a((a), match_str); |
109 location->match_string = cx_strdup_a((a), match_str); |
| 109 |
110 |
| 110 if(match == WS_LOCATION_MATCH_CS_REGEX || match == WS_LOCATION_MATCH_CI_REGEX) { |
111 if(match == WS_LOCATION_MATCH_CS_REGEX || match == WS_LOCATION_MATCH_CI_REGEX) { |
| 111 if(regcomp(&location->regex, match_str.ptr, regex_flags)) { |
112 if(regcomp(&location->regex, match_str.ptr, regex_flags)) { |
| 112 log_ereport(LOG_FAILURE, "Location: cannot compile regex pattern %s", match_str.ptr); |
113 log_ereport(LOG_FAILURE, "Location: cannot compile regex pattern %s", match_str.ptr); |