commit - 7f722d7ca7646a910da609fd4240e6b666c564dc
commit + 07226cf792be7df8fc8060ee426e20670bcb366e
blob - efad396a4f83d1910bb9700fcc160fdb9cc9b687
blob + 853657757043f3f941a13e6f14ebd5391ec75b02
--- gotwebd/config.c
+++ gotwebd/config.c
strlcpy(env->httpd_chroot, D_HTTPD_CHROOT, sizeof(env->httpd_chroot));
env->prefork = GOTWEBD_NUMPROC;
- env->server_cnt = 0;
TAILQ_INIT(&env->servers);
TAILQ_INIT(&env->sockets);
TAILQ_INIT(&env->addresses);
blob - 2f73110cb2228a1cabcbcc6fc2e90b4f8f6c6f49
blob + 8c488fc0867abc93a3343e161d7144f9d29b13ab
--- gotwebd/gotwebd.c
+++ gotwebd/gotwebd.c
argv[argc++] = "-F";
argv[argc++] = username;
} else if (proc_type == GOTWEBD_PROC_GOTWEB) {
- char *s;
-
argv[argc++] = "-G";
argv[argc++] = username;
- if (asprintf(&s, "-G%d", env->server_cnt) == -1)
- fatal("asprintf");
- argv[argc++] = s;
}
if (strcmp(env->gotwebd_conffile, GOTWEBD_CONF) != 0) {
argv[argc++] = "-f";
break;
case 'G':
proc_type = GOTWEBD_PROC_GOTWEB;
- i = strtonum(optarg, 1, INT_MAX, &errstr);
- if (errstr)
- gotwebd_username = optarg;
- else
- env->server_cnt = i;
+ gotwebd_username = optarg;
break;
case 'f':
conffile = optarg;
blob - 264aea1b3238702f4213e6d79fcfb8d45ebb2f41
blob + 6489b482539e9ef0150b04e9a512b49639c16e3d
--- gotwebd/gotwebd.h
+++ gotwebd/gotwebd.h
int gotweb_pending;
int gotweb_cur;
int *worker_load;
-
- int server_cnt;
char httpd_chroot[PATH_MAX];
};
blob - 65b596837a8e6b7c519539990d6e73bf5253709b
blob + 97ec22290beca05e6559e486e6497dcad058d4b2
--- gotwebd/parse.y
+++ gotwebd/parse.y
}
/* just add default server if no config specified */
- if (gotwebd->server_cnt == 0)
+ if (TAILQ_EMPTY(&gotwebd->servers))
add_default_server();
/* add the implicit listen on socket */
srv->summary_tags_display = D_MAXSLTAGDISP;
TAILQ_INSERT_TAIL(&gotwebd->servers, srv, entry);
- gotwebd->server_cnt++;
return srv;
};