src/server/daemon/rewrite.c

changeset 651
ed74879c7041
parent 647
ffbc5076b4bf
child 652
dd90c858eb74
equal deleted inserted replaced
650:3e4f9cdd70b8 651:ed74879c7041
25 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 25 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26 * POSSIBILITY OF SUCH DAMAGE. 26 * POSSIBILITY OF SUCH DAMAGE.
27 */ 27 */
28 28
29 #include "rewrite.h" 29 #include "rewrite.h"
30 #include "config.h"
30 31
31 32
32 RewriteRule* rewrite_rule_create(const CxAllocator *a, cxmutstr regex, cxmutstr url) { 33 RewriteRule* rewrite_rule_create(ServerConfiguration *cfg, cxmutstr regex, cxmutstr url) {
34 const CxAllocator *a = cfg->a;
35
33 regex_t reg; 36 regex_t reg;
34 if(regex.ptr) { 37 if(regex.ptr) {
35 if(regcomp(&reg, regex.ptr, REG_EXTENDED)) { 38 if(regcomp(&reg, regex.ptr, REG_EXTENDED)) {
36 log_ereport(LOG_FAILURE, "rewrite: cannot compile regex: %s", regex.ptr); 39 log_ereport(LOG_FAILURE, "rewrite: cannot compile regex: %s", regex.ptr);
37 return NULL; 40 return NULL;

mercurial