commit - 717a78d4f87c3704afe34c77e211349932575d5b
commit + 62f852145bf61e3ed9b42f7a00cd7cd0b5ff8835
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 - c6ccf95e24f012d09dd077471386a59ca45b0d87
blob + 08b1a2f6f58ebda079361a779c7749acb5a02cf7
--- 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 - f816f6ca9b9437b918e168e92de554c7f3df27af
blob + 283e69d247baeb718f827dfff89f769ca1e9e125
--- 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__);