commit - 438d0cc30baf8e97fd870f5e620833e0a45401aa
commit + e087e1f6e7b926dcff23d90de416399c114d582e
blob - b58b1e7be0421dac9ff6c9717bacb59208ad1bbb
blob + 2d740d8c68ee194fe07fbfdcd32adc917ba70b44
--- gotwebd/gotwebd.h
+++ gotwebd/gotwebd.h
struct server {
TAILQ_ENTRY(server) entry;
- struct addresslist *al;
+ struct addresslist al;
char name[GOTWEBD_MAXTEXT];
};
struct socket_conf {
- struct addresslist *al;
+ struct addresslist al;
char name[GOTWEBD_MAXTEXT];
char srv_name[GOTWEBD_MAXTEXT];
blob - 748db3ece24e2a35e37196d7d1f2d8f1a3b071c8
blob + 6a19cc971eac7c808d5e66cf765ae45df9f34677
--- gotwebd/parse.y
+++ gotwebd/parse.y
new_srv = conf_new_server($2);
if (new_srv->fcgi_socket)
if (get_addrs(new_srv->fcgi_socket_bind,
- new_srv->al,
+ &new_srv->al,
new_srv->fcgi_socket_port) == -1) {
yyerror("could not get tcp iface "
"addrs");
free($2);
} '{' optnl serveropts2 '}' {
if (get_addrs(new_srv->fcgi_socket_bind,
- new_srv->al, new_srv->fcgi_socket_port) == -1) {
+ &new_srv->al, new_srv->fcgi_socket_port) == -1) {
yyerror("could not get tcp iface addrs");
YYERROR;
}
srv->unix_socket = 1;
srv->fcgi_socket = gotwebd->fcgi_socket ? gotwebd->fcgi_socket : 0;
- if ((srv->al = calloc(1, sizeof(*srv->al))) == NULL)
- fatalx("%s: calloc", __func__);
-
- TAILQ_INIT(srv->al);
+ TAILQ_INIT(&srv->al);
TAILQ_INSERT_TAIL(gotwebd->servers, srv, entry);
gotwebd->server_cnt++;
blob - cf2a3d1df8e8ab807643e41c0104908853476046
blob + b60e44674a3b5851bb5126437284adc08abea47d
--- gotwebd/sockets.c
+++ gotwebd/sockets.c
TAILQ_FOREACH(sock, env->sockets, entry) {
ipv4 = ipv6 = 0;
- TAILQ_FOREACH(a, sock->conf.al, entry) {
+ TAILQ_FOREACH(a, &sock->conf.al, entry) {
if (a->ss.ss_family == AF_INET)
ipv4 = 1;
if (a->ss.ss_family == AF_INET6)
n = snprintf(sock->conf.name, GOTWEBD_MAXTEXT, "%s_child",
p_sock->conf.srv_name);
if (n < 0 || (size_t)n >= GOTWEBD_MAXTEXT) {
- free(p_sock->conf.al);
free(p_sock);
- free(sock->conf.al);
free(sock);
fatalx("%s: snprintf", __func__);
}
- TAILQ_FOREACH(a, p_sock->conf.al, entry) {
+ TAILQ_FOREACH(a, &p_sock->conf.al, entry) {
if (a->ss.ss_family == AF_INET)
continue;
}
}
- TAILQ_INSERT_TAIL(sock->conf.al, acp, entry);
+ TAILQ_INSERT_TAIL(&sock->conf.al, acp, entry);
}
}
if ((sock = calloc(1, sizeof(*sock))) == NULL)
fatalx("%s: calloc", __func__);
- if ((sock->conf.al = calloc(1, sizeof(*sock->conf.al))) == NULL) {
- free(sock);
- fatalx("%s: calloc", __func__);
- }
- TAILQ_INIT(sock->conf.al);
+ TAILQ_INIT(&sock->conf.al);
sock->conf.parent_id = 0;
sock->conf.id = id;
srv->unix_socket_name,
sizeof(sock->conf.unix_socket_name)) >=
sizeof(sock->conf.unix_socket_name)) {
- free(sock->conf.al);
free(sock);
fatalx("%s: strlcpy", __func__);
}
n = snprintf(sock->conf.name, GOTWEBD_MAXTEXT, "%s_parent",
srv->name);
if (n < 0 || (size_t)n >= GOTWEBD_MAXTEXT) {
- free(sock->conf.al);
free(sock);
fatalx("%s: snprintf", __func__);
}
if (strlcpy(sock->conf.srv_name, srv->name,
sizeof(sock->conf.srv_name)) >= sizeof(sock->conf.srv_name)) {
- free(sock->conf.al);
free(sock);
fatalx("%s: strlcpy", __func__);
}
- TAILQ_FOREACH(a, srv->al, entry) {
+ TAILQ_FOREACH(a, &srv->al, entry) {
if ((acp = calloc(1, sizeof(*acp))) == NULL) {
- free(sock->conf.al);
free(sock);
fatal("%s: calloc", __func__);
}
}
}
- TAILQ_INSERT_TAIL(sock->conf.al, acp, entry);
+ TAILQ_INSERT_TAIL(&sock->conf.al, acp, entry);
}
done:
return (sock);
if (sock->conf.type == FCGI) {
log_debug("%s: initializing fcgi socket for %s", __func__,
sock->conf.name);
- sock->fd = sockets_create_socket(sock->conf.al,
+ sock->fd = sockets_create_socket(&sock->conf.al,
sock->conf.fcgi_socket_port);
if (sock->fd == -1) {
log_warnx("%s: create unix socket failed", __func__);