]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MEDIUM: fcgi-app: properly postresolve logsrvs
authorAurelien DARRAGON <adarragon@haproxy.com>
Tue, 4 Jul 2023 15:01:09 +0000 (17:01 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Wed, 6 Sep 2023 14:06:39 +0000 (16:06 +0200)
Now that we have postresolve_logsrv_list() function, we make use of it
for fcgi-app log postparsing logic.

This will allow this kind of config to work:
  |fcgi-app test
  |        docroot /
  |        log-stderr tcp@127.0.0.1:514 local0

Plus, consistency checks will also be performed as for regular log
directives used from global, log-forward or proxy sections.

src/fcgi-app.c

index 16c3c81bb5c3281c6e955637f5135c58265e7921..829d1b128b394d242b987ea9b379704134589074 100644 (file)
@@ -645,7 +645,6 @@ static int cfg_fcgi_apps_postparser()
        struct fcgi_app *curapp;
        struct proxy *px;
        struct server *srv;
-       struct logsrv *logsrv;
        int err_code = 0;
 
        for (px = proxies_list; px; px = px->next) {
@@ -701,18 +700,7 @@ static int cfg_fcgi_apps_postparser()
                        curapp->maxreqs = 1;
                }
 
-               list_for_each_entry(logsrv, &curapp->logsrvs, list) {
-                       if (logsrv->type == LOG_TARGET_BUFFER) {
-                               struct sink *sink = sink_find(logsrv->ring_name);
-
-                               if (!sink || sink->type != SINK_TYPE_BUFFER) {
-                                       ha_alert("fcgi-app '%s' : log server uses unknown ring named '%s'.\n",
-                                                curapp->name, logsrv->ring_name);
-                                       err_code |= ERR_ALERT | ERR_FATAL;
-                               }
-                               logsrv->sink = sink;
-                       }
-               }
+               err_code |= postresolve_logsrv_list(&curapp->logsrvs, "fcgi-app", curapp->name);
        }
 
   end: