From 8ee650a88bbb3d38e2735a7bbacf1944a56c839a Mon Sep 17 00:00:00 2001 From: Christopher Faulet Date: Tue, 3 Jun 2025 11:06:09 +0200 Subject: [PATCH] CLEANUP: applet: Update comment for applet_put* functions These functions were copied from the channel API and modified to work with applets using the new API or the legacy one. However, the comments were updated accordingly. It is the purpose of this patch. --- include/haproxy/applet.h | 34 +++++++++++++++++++++------------- 1 file changed, 21 insertions(+), 13 deletions(-) diff --git a/include/haproxy/applet.h b/include/haproxy/applet.h index dbf0b15a0..db7336e79 100644 --- a/include/haproxy/applet.h +++ b/include/haproxy/applet.h @@ -318,9 +318,11 @@ static inline int _applet_putchk(struct appctx *appctx, struct buffer *chunk, return ret; } -/* writes chunk into the input channel of the stream attached to this - * appctx's endpoint, and marks the SC_FL_NEED_ROOM on a channel full error. - * See ci_putchk() for the list of return codes. +/* writes chunk into the applet's output buffer if it uses its own + * bufferx or into the input channel of the stream attached to this applet. + * + * Returns the number of written bytes on success or -1 on error (lake of space, + * shutdown, invalid call...) */ static inline int applet_putchk(struct appctx *appctx, struct buffer *chunk) { @@ -333,9 +335,11 @@ static inline int applet_putchk_stress(struct appctx *appctx, struct buffer *chu return _applet_putchk(appctx, chunk, 1); } -/* writes chars from into the input channel of the stream attached - * to this appctx's endpoint, and marks the SC_FL_NEED_ROOM on a channel full - * error. See ci_putblk() for the list of return codes. +/* writes chars from into the applet's output buffer if it uses its own + * bufferx or into the input channel of the stream attached to this applet. + * + * Returns the number of written bytes on success or -1 on error (lake of space, + * shutdown, invalid call...) */ static inline int applet_putblk(struct appctx *appctx, const char *blk, int len) { @@ -367,10 +371,12 @@ static inline int applet_putblk(struct appctx *appctx, const char *blk, int len) return ret; } -/* writes chars from up to the trailing zero (excluded) into the input - * channel of the stream attached to this appctx's endpoint, and marks the - * SC_FL_NEED_ROOM on a channel full error. See ci_putstr() for the list of - * return codes. +/* writes chars from up to the trailing zero (excluded) into the applet's + * output buffer if it uses its own bufferx or into the input channel of the + * stream attached to this applet. + * + * Returns the number of written bytes on success or -1 on error (lake of space, + * shutdown, invalid call...) */ static inline int applet_putstr(struct appctx *appctx, const char *str) { @@ -403,9 +409,11 @@ static inline int applet_putstr(struct appctx *appctx, const char *str) return ret; } -/* writes character into the input channel of the stream attached to this - * appctx's endpoint, and marks the SC_FL_NEED_ROOM on a channel full error. - * See ci_putchr() for the list of return codes. +/* writes character into the applet's output buffer if it uses its own + * bufferx or into the input channel of the stream attached to this applet. + * + * Returns the number of written bytes on success or -1 on error (lake of space, + * shutdown, invalid call...) */ static inline int applet_putchr(struct appctx *appctx, char chr) {