diff --git a/include/haproxy/applet-t.h b/include/haproxy/applet-t.h index adeb9da12..8b31e02bc 100644 --- a/include/haproxy/applet-t.h +++ b/include/haproxy/applet-t.h @@ -82,6 +82,7 @@ static forceinline char *appctx_show_flags(char *buf, size_t len, const char *de } #define APPLET_FL_NEW_API 0x00000001 /* Set if the applet is based on the new API (using applet's buffers) */ +#define APPLET_FL_WARNED 0x00000002 /* Set when warning was already emitted about a legacy applet */ /* Applet descriptor */ struct applet { diff --git a/src/applet.c b/src/applet.c index 1cd10e038..6bfff12de 100644 --- a/src/applet.c +++ b/src/applet.c @@ -19,6 +19,7 @@ #include #include #include +#include #include #include #include @@ -232,6 +233,13 @@ struct appctx *appctx_new_on(struct applet *applet, struct sedesc *sedesc, int t TRACE_ENTER(APPLET_EV_NEW); + if (unlikely(!(applet->flags & (APPLET_FL_NEW_API|APPLET_FL_WARNED)))) { + send_log(NULL, LOG_WARNING, + "Applet '%s' is based on a deprecated API. Please report this error to developers\n", + applet->name); + applet->flags |= APPLET_FL_WARNED; + } + appctx = pool_zalloc(pool_head_appctx); if (unlikely(!appctx)) { TRACE_ERROR("APPCTX allocation failure", APPLET_EV_NEW|APPLET_EV_ERR);