X-Git-Url: http://dolda2000.com/gitweb/?a=blobdiff_plain;f=src%2Fpatplex.c;h=d0e2dade2fff96eca07c407fc34c857e633af452;hb=b1b0fe0f4793825232288427da4856e9adf8b868;hp=23fcf4eadb4738815b44145571268a3b91727c72;hpb=4dc7f716a7b4be064ecf86f6e1444b7b39dfdfe7;p=ashd.git diff --git a/src/patplex.c b/src/patplex.c index 23fcf4e..d0e2dad 100644 --- a/src/patplex.c +++ b/src/patplex.c @@ -189,6 +189,7 @@ static struct pattern *parsepattern(struct cfstate *s) flog(LOG_WARNING, "%s:%i: missing pattern for `%s' match", s->file, s->lno, s->argv[0]); continue; } + rxfl = 0; if(s->argc >= 3) { if(strchr(s->argv[2], 'i')) rxfl |= REG_ICASE; @@ -216,6 +217,7 @@ static struct pattern *parsepattern(struct cfstate *s) flog(LOG_WARNING, "%s:%i: missing header name or pattern for `header' match", s->file, s->lno); continue; } + rxfl = 0; if(s->argc >= 4) { if(strchr(s->argv[3], 'i')) rxfl |= REG_ICASE; @@ -470,6 +472,14 @@ static struct pattern *findmatch(struct config *cf, struct hthead *req, int tryd return(NULL); } +static void childerror(struct hthead *req, int fd) +{ + if(errno == EAGAIN) + simpleerror(fd, 500, "Server Error", "The request handler is overloaded."); + else + simpleerror(fd, 500, "Server Error", "The request handler crashed."); +} + static void serve(struct hthead *req, int fd) { struct pattern *pat; @@ -509,7 +519,7 @@ static void serve(struct hthead *req, int fd) headappheader(req, head->name, head->value); } if(childhandle(ch, req, fd, NULL, NULL)) - simpleerror(fd, 500, "Server Error", "The request handler crashed."); + childerror(req, fd); } static void reloadconf(char *nm)