}
}
+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 handle(struct hthead *req, int fd, char *path, struct pattern *pat)
{
struct child *ch;
}
headappheader(req, "X-Ash-File", path);
if(childhandle(ch, req, fd, chinit, twd))
- simpleerror(fd, 500, "Server Error", "The request handler crashed.");
+ childerror(req, fd);
}
}
tmp = sstrdup(path);
ch = findchild(tmp, ".notfound", &ccf);
if(childhandle(ch, req, fd, chinit, ccf?ccf->path:NULL))
- simpleerror(fd, 500, "Server Error", "The request handler crashed.");
+ childerror(req, fd);
free(tmp);
}
rest++;
replrest(req, rest);
if(childhandle(ch, req, fd, chinit, ccf?ccf->path:NULL))
- simpleerror(fd, 500, "Server Error", "The request handler crashed.");
+ childerror(req, fd);
return(1);
}
return(0);
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;
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)