- if((ch = getchild(config, chnm)) == NULL) {
- flog(LOG_ERR, "child %s requested, but was not declared", chnm);
- simpleerror(fd, 500, "Configuration Error", "The server is erroneously configured. Handler %s was requested, but not declared.", chnm);
+ execmatch(req, match);
+ switch(match->pat->handler) {
+ case HND_CHILD:
+ ch = NULL;
+ if(ch == NULL)
+ ch = getchild(lconfig, match->pat->childnm);
+ if((ch == NULL) && (gconfig != NULL))
+ ch = getchild(gconfig, match->pat->childnm);
+ if(ch == NULL) {
+ flog(LOG_ERR, "child %s requested, but was not declared", match->pat->childnm);
+ simpleerror(fd, 500, "Configuration Error", "The server is erroneously configured. Handler %s was requested, but not declared.", match->pat->childnm);
+ break;
+ }
+ if(childhandle(ch, req, fd, NULL, NULL))
+ childerror(req, fd);
+ break;
+ case HND_REPARSE:
+ match->pat->disable = 1;
+ serve(req, fd);
+ match->pat->disable = 0;
+ break;
+ default:
+ abort();
+ }
+ freematch(match);
+}
+
+static void reloadconf(char *nm)
+{
+ struct config *cf;
+
+ if((cf = readconfig(nm)) == NULL) {
+ flog(LOG_WARNING, "could not reload configuration file `%s'", nm);