now forward_px only serves as a hint to know if a proxy was created
specifically for the sink, in which case the sink is responsible for it.
Everywhere forward_px was used in appctx context: get the parent proxy from
the sft->srv instead.
This permits to finally get rid of the double link dependency between sink
and proxy.
enum log_fmt fmt; // format expected by the sink
enum sink_type type; // type of storage
uint32_t maxlen; // max message length (truncated above)
- struct proxy* forward_px; // proxy used to forward
+ struct proxy* forward_px; // internal proxy used to forward (only set when exclusive to sink)
struct sink_forward_target *sft; // sink forward targets
struct task *forward_task; // task to handle forward targets conns
struct sig_handler *forward_sighandler; /* signal handler */
if (!sockaddr_alloc(&addr, &sft->srv->addr, sizeof(sft->srv->addr)))
goto out_error;
- if (appctx_finalize_startup(appctx, sft->sink->forward_px, &BUF_NULL) == -1)
+ if (appctx_finalize_startup(appctx, sft->srv->proxy, &BUF_NULL) == -1)
goto out_free_addr;
s = appctx_strm(appctx);
}
/* Helper function to create new high-level ring buffer (as in ring section from
- * the config)
+ * the config): will create a new sink of buf type, and a new forward proxy,
+ * which will be stored in forward_px to know that the sink is responsible for
+ * it.
*
* Returns NULL on failure
*/