]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
CLEANUP: applet: Update comment for applet_put* functions
authorChristopher Faulet <cfaulet@haproxy.com>
Tue, 3 Jun 2025 09:06:09 +0000 (11:06 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Tue, 3 Jun 2025 13:03:30 +0000 (15:03 +0200)
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

index dbf0b15a0fb8c73ec9de80131994cfac1644119c..db7336e797afa83adcaf07deff673b6c26fe4a97 100644 (file)
@@ -318,9 +318,11 @@ static inline int _applet_putchk(struct appctx *appctx, struct buffer *chunk,
        return ret;
 }
 
-/* writes chunk <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 <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 <len> chars from <blk> 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 <len> chars from <blk> 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 <str> 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 <str> 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 <chr> 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 <chr> 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)
 {