]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: actions: add a function returning a service pointer from its name
authorThierry Fournier <thierry.fournier@ozon.io>
Sat, 28 Nov 2020 18:32:14 +0000 (19:32 +0100)
committerWilly Tarreau <w@1wt.eu>
Wed, 2 Dec 2020 08:45:18 +0000 (09:45 +0100)
This function simply calls action_lookup() on the private service_keywords,
to look up a service name. This will be used to detect double registration
of a same service from Lua.

This will be needed by a next patch to fix a bug and will have to be
backported.

include/haproxy/stream.h
src/stream.c

index d9f2e185be4eb0f9e39379cc97ccfe6d049dbcae..e50fbc8af90ae8c55667b6a10aa98016a246538a 100644 (file)
@@ -416,6 +416,7 @@ static inline void stream_choose_redispatch(struct stream *s)
 }
 
 void service_keywords_register(struct action_kw_list *kw_list);
+struct action_kw *service_find(const char *kw);
 void list_services(FILE *out);
 
 #endif /* _HAPROXY_STREAM_H */
index 8d6bdb26c6e6c98fbab803ea85f3c4ca132761ad..15ea23d09d6a8f6281ada8ca6781e5882769837f 100644 (file)
@@ -2770,6 +2770,11 @@ void service_keywords_register(struct action_kw_list *kw_list)
        LIST_ADDQ(&service_keywords, &kw_list->list);
 }
 
+struct action_kw *service_find(const char *kw)
+{
+       return action_lookup(&service_keywords, kw);
+}
+
 /* Lists the known services on <out> */
 void list_services(FILE *out)
 {