X-Git-Url: http://dolda2000.com/gitweb/?a=blobdiff_plain;f=src%2Fdirplex%2Fdirplex.c;h=d6879573cd397d4be6152ba13a7ea06d5479b6c4;hb=54490135194e0474e753ce7d4cb60f935dad1dd4;hp=c6da4b69c03003755379bd3f895caba52eb5d191;hpb=a017e22882b2e4b2a1fa0c3b077bc87a89906a69;p=ashd.git diff --git a/src/dirplex/dirplex.c b/src/dirplex/dirplex.c index c6da4b6..d687957 100644 --- a/src/dirplex/dirplex.c +++ b/src/dirplex/dirplex.c @@ -59,8 +59,13 @@ static void handle(struct hthead *req, int fd, char *path, struct pattern *pat) { struct child *ch; struct config *ccf; + struct headmod *head; char *twd; + for(head = pat->headers; head != NULL; head = head->next) { + headrmheader(req, head->name); + headappheader(req, head->name, head->value); + } if(!strncmp(path, "./", 2) && path[2]) path += 2; if(pat->fchild) { @@ -239,7 +244,7 @@ static int checkdir(struct hthead *req, int fd, char *path, char *rest) struct child *ch; cf = getconfig(path); - if(cf->capture != NULL) { + if((cf->capture != NULL) && (cf->caproot || !cf->path || strcmp(cf->path, "."))) { cpath = sprintf2("%s/", path); if((ch = findchild(cpath, cf->capture, &ccf)) == NULL) { free(cpath); @@ -315,10 +320,12 @@ static void serve(struct hthead *req, int fd) static void chldhandler(int sig) { pid_t pid; + int st; - do { - pid = waitpid(-1, NULL, WNOHANG); - } while(pid > 0); + while((pid = waitpid(-1, &st, WNOHANG)) > 0) { + if(WCOREDUMP(st)) + flog(LOG_WARNING, "child process %i dumped core", pid); + } } static void sighandler(int sig)