X-Git-Url: http://www.dolda2000.com/gitweb/?a=blobdiff_plain;f=src%2Fpatplex.c;h=99395439123500ab914cf5cd385093c83b5a93a1;hb=407963f25c664cd1450ec5f6eeb80c449ff57e74;hp=692d48021380a1c73105699a1e6e03583d6d722b;hpb=7026d1878e72d10882ef76f74b2164df846c3705;p=ashd.git diff --git a/src/patplex.c b/src/patplex.c index 692d480..9939543 100644 --- a/src/patplex.c +++ b/src/patplex.c @@ -383,12 +383,14 @@ static void qoffsets(char *buf, int *obuf, char *pstr, int unquote) o++; } buf[o] = 0; + obuf[o] = i; } else { for(i = 0; pstr[i]; i++) { buf[i] = pstr[i]; obuf[i] = i; } buf[i] = 0; + obuf[i] = i; } } @@ -472,6 +474,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; @@ -511,7 +521,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)