commit - cf4650e179df57c8f7e985b49948138547765af7
commit + da64fca0d1dd094bdc5e399298ffbcb3f935d11d
blob - 24a9352100d646dad06a2b1e5b107b6a99b471b8
blob + 5b6c4f611de441b8dee08ed52fd642dff811ef24
--- 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 - 5f72ef9e31fdd912c972f55367db8538e012b9b9
blob + 600ae4ab3ee85bedda503b83acca5478add18573
--- 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 - f6da39132c94a229b98735aa2e9a44a4d415076d
blob + 49402203bcfefd1783a8fe05ceee15fb09a60d9e
--- 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;
};