- simpleerror(fd, 500, "Server Error", "The request handler crashed.");
+ childerror(req, fd);
+ }
+}
+
+static void handle404(struct hthead *req, int fd, char *path)
+{
+ struct child *ch;
+ struct config *ccf;
+ struct pattern *pat;
+
+ char tmp[strlen(path) + 1];
+ strcpy(tmp, path);
+ if((pat = findmatch(tmp, 0, PT_NOTFOUND)) != NULL) {
+ handle(req, fd, tmp, pat);
+ } else {
+ ch = findchild(tmp, ".notfound", &ccf);
+ if(childhandle(ch, req, fd, chinit, ccf?ccf->path:NULL))
+ childerror(req, fd);