[master] f52e7c3fd acceptor: Give open functions only the options part of av

Nils Goroll nils.goroll at uplex.de
Mon Sep 30 15:53:07 UTC 2024


commit f52e7c3fd2b8b85a8e919ada8c14a521d05d1143
Author: Nils Goroll <nils.goroll at uplex.de>
Date:   Thu Sep 5 15:21:43 2024 +0200

    acceptor: Give open functions only the options part of av
    
    av[0] is already passed as la->name, av[1] as la->endpoint

diff --git a/bin/varnishd/acceptor/mgt_acceptor.c b/bin/varnishd/acceptor/mgt_acceptor.c
index 8286ae71b..38ba7ac99 100644
--- a/bin/varnishd/acceptor/mgt_acceptor.c
+++ b/bin/varnishd/acceptor/mgt_acceptor.c
@@ -147,7 +147,7 @@ VCA_Arg(const char *spec)
 		vca = VCA_Find("tcp");
 
 	AN(vca);
-	error = vca->open(av, la, &err);
+	error = vca->open(av + 2, la, &err);
 
 	if (error)
 		ARGV_ERR("Got no socket(s) for %s (%s)\n", av[1], err);
diff --git a/bin/varnishd/acceptor/mgt_acceptor_tcp.c b/bin/varnishd/acceptor/mgt_acceptor_tcp.c
index 364b56d8f..3b41ef140 100644
--- a/bin/varnishd/acceptor/mgt_acceptor_tcp.c
+++ b/bin/varnishd/acceptor/mgt_acceptor_tcp.c
@@ -176,7 +176,7 @@ vca_tcp_open(char **av, struct listen_arg *la, const char **err)
 		ARGV_ERR("Unix domain socket addresses must be"
 		    " absolute paths in -a (%s)\n", la->endpoint);
 
-	for (int i = 2; av[i] != NULL; i++) {
+	for (int i = 0; av[i] != NULL; i++) {
 		if (strchr(av[i], '=') == NULL) {
 			if (xp != NULL)
 				ARGV_ERR("Too many protocol sub-args"
@@ -196,7 +196,7 @@ vca_tcp_open(char **av, struct listen_arg *la, const char **err)
 	AN(xp);
 	la->transport = xp;
 
-	return (VSS_resolver_range(av[1], "80", vca_tcp_open_cb, la, err));
+	return (VSS_resolver_range(la->endpoint, "80", vca_tcp_open_cb, la, err));
 }
 
 int
diff --git a/bin/varnishd/acceptor/mgt_acceptor_uds.c b/bin/varnishd/acceptor/mgt_acceptor_uds.c
index 97635b712..325268797 100644
--- a/bin/varnishd/acceptor/mgt_acceptor_uds.c
+++ b/bin/varnishd/acceptor/mgt_acceptor_uds.c
@@ -181,7 +181,7 @@ vca_uds_open(char **av, struct listen_arg *la, const char **err)
 
 	heritage.min_vcl_version = vmax(heritage.min_vcl_version, 41U);
 
-	for (int i = 2; av[i] != NULL; i++) {
+	for (int i = 0; av[i] != NULL; i++) {
 		char *eq, *val;
 		int len;
 


More information about the varnish-commit mailing list