which is actually the same thing (cluebat from reyk@).
-/* $OpenBSD: httpd.h,v 1.105 2016/08/15 13:48:24 jsing Exp $ */
+/* $OpenBSD: httpd.h,v 1.106 2016/08/15 16:12:34 jsing Exp $ */
/*
* Copyright (c) 2006 - 2015 Reyk Floeter <reyk@openbsd.org>
serverconfig_byid(uint32_t);
int server_foreach(int (*)(struct server *,
struct server_config *, void *), void *);
+struct server *
+ server_match(struct server *, int);
SPLAY_PROTOTYPE(client_tree, client, clt_nodes, server_client_cmp);
-/* $OpenBSD: parse.y,v 1.79 2016/08/15 13:48:24 jsing Exp $ */
+/* $OpenBSD: parse.y,v 1.80 2016/08/15 16:12:34 jsing Exp $ */
/*
* Copyright (c) 2007 - 2015 Reyk Floeter <reyk@openbsd.org>
int host(const char *, struct addresslist *,
int, struct portrange *, const char *, int);
void host_free(struct addresslist *);
-struct server *server_match(struct server *, int);
struct server *server_inherit(struct server *, struct server_config *,
struct server_config *);
int getservice(char *);
}
}
-struct server *
-server_match(struct server *s2, int match_name)
-{
- struct server *s1;
-
- /* Attempt to find matching server. */
- TAILQ_FOREACH(s1, conf->sc_servers, srv_entry) {
- if ((s1->srv_conf.flags & SRVFLAG_LOCATION) != 0)
- continue;
- if (match_name) {
- if (strcmp(s1->srv_conf.name, s2->srv_conf.name) != 0)
- continue;
- }
- if (s1->srv_conf.port != s2->srv_conf.port)
- continue;
- if (sockaddr_cmp(
- (struct sockaddr *)&s1->srv_conf.ss,
- (struct sockaddr *)&s2->srv_conf.ss,
- s1->srv_conf.prefixlen) != 0)
- continue;
-
- return (s1);
- }
-
- return (NULL);
-}
-
struct server *
server_inherit(struct server *src, struct server_config *alias,
struct server_config *addr)
-/* $OpenBSD: server.c,v 1.87 2016/08/15 14:14:55 jsing Exp $ */
+/* $OpenBSD: server.c,v 1.88 2016/08/15 16:12:34 jsing Exp $ */
/*
* Copyright (c) 2006 - 2015 Reyk Floeter <reyk@openbsd.org>
return (0);
}
+struct server *
+server_match(struct server *s2, int match_name)
+{
+ struct server *s1;
+
+ /* Attempt to find matching server. */
+ TAILQ_FOREACH(s1, env->sc_servers, srv_entry) {
+ if ((s1->srv_conf.flags & SRVFLAG_LOCATION) != 0)
+ continue;
+ if (match_name) {
+ if (strcmp(s1->srv_conf.name, s2->srv_conf.name) != 0)
+ continue;
+ }
+ if (s1->srv_conf.port != s2->srv_conf.port)
+ continue;
+ if (sockaddr_cmp(
+ (struct sockaddr *)&s1->srv_conf.ss,
+ (struct sockaddr *)&s2->srv_conf.ss,
+ s1->srv_conf.prefixlen) != 0)
+ continue;
+
+ return (s1);
+ }
+
+ return (NULL);
+}
+
int
server_socket_af(struct sockaddr_storage *ss, in_port_t port)
{