]> git.kaiwu.me - haproxy.git/commitdiff
CLEANUP: tree-wide: fix typos in non user-visible comments in 15 files
authorWilly Tarreau <w@1wt.eu>
Sun, 10 May 2026 17:36:51 +0000 (17:36 +0000)
committerWilly Tarreau <w@1wt.eu>
Mon, 11 May 2026 14:01:50 +0000 (16:01 +0200)
This fixes typos and spelling mistakes in the following files:

  channel-t.h channel.h filters-t.h http_htx.h htx-t.h tools.h
  cfgcond.c channel.c flt_http_comp.c http_ana.c htx.c mqtt.c
  mux_h1.c regex.c stats-proxy.c

15 files changed:
include/haproxy/channel-t.h
include/haproxy/channel.h
include/haproxy/filters-t.h
include/haproxy/http_htx.h
include/haproxy/htx-t.h
include/haproxy/tools.h
src/cfgcond.c
src/channel.c
src/flt_http_comp.c
src/http_ana.c
src/htx.c
src/mqtt.c
src/mux_h1.c
src/regex.c
src/stats-proxy.c

index a2a11a561bdf98ec752587857415ecffb8dbf25f..cddfab82f0beed2e8d47a55a751e6d5e3ea5f522 100644 (file)
@@ -76,7 +76,7 @@
 
 #define CF_WAKE_ONCE      0x10000000  /* pretend there is activity on this channel (one-shoot) */
 #define CF_FLT_ANALYZE    0x20000000  /* at least one filter is still analyzing this channel */
-/* unuse 0x40000000 */
+/* unused 0x40000000 */
 #define CF_ISRESP         0x80000000  /* 0 = request channel, 1 = response channel */
 
 /* Masks which define input events for stream analysers */
@@ -252,27 +252,30 @@ struct channel {
  * without waking the parent up. The special value CHN_INFINITE_FORWARD is
  * never decreased nor increased.
  *
- * The buf->o parameter says how many bytes may be consumed from the visible
- * buffer. This parameter is updated by any buffer_write() as well as any data
- * forwarded through the visible buffer. Since the ->to_forward attribute
- * applies to data after buf->p, an analyser will not see a buffer which has a
- * non-null ->to_forward with buf->i > 0. A producer is responsible for raising
- * buf->o by min(to_forward, buf->i) when it injects data into the buffer.
+ * The channel's consumed data count (b_data(chn->buf)) says how many bytes may
+ * be consumed from the visible buffer. This is updated by any buffer_write()
+ * as well as any data forwarded through the visible buffer. Since the
+ * ->to_forward attribute applies to data beyond what's already been accounted
+ * for, an analyser will not see a buffer which has a non-null ->to_forward
+ * with additional unprocessed data. A producer is responsible for raising the
+ * consumed count by min(to_forward, available_data) when it injects data into
+ * the buffer.
  *
- * The consumer is responsible for decreasing ->buf->o when it sends data
- * from the visible buffer, and ->pipe->data when it sends data from the
- * invisible buffer.
+ * The consumer is responsible for advancing the consumed count (via
+ * b_ack()) when it sends data from the visible buffer, and for updating
+ * ->pipe->data when it sends data from the invisible buffer.
  *
  * A real-world example consists in part in an HTTP response waiting in a
  * buffer to be forwarded. We know the header length (300) and the amount of
  * data to forward (content-length=9000). The buffer already contains 1000
  * bytes of data after the 300 bytes of headers. Thus the caller will set
- * buf->o to 300 indicating that it explicitly wants to send those data, and
- * set ->to_forward to 9000 (content-length). This value must be normalised
- * immediately after updating ->to_forward : since there are already 1300 bytes
- * in the buffer, 300 of which are already counted in buf->o, and that size
- * is smaller than ->to_forward, we must update buf->o to 1300 to flush the
- * whole buffer, and reduce ->to_forward to 8000. After that, the producer may
+ * the consumed count to 300 indicating that it explicitly wants to send those
+ * data, and set ->to_forward to 9000 (content-length). This value must be
+ * normalised immediately after updating ->to_forward : since there are already
+ * 1300 bytes in the buffer, 300 of which are already counted in the consumed
+ * count, and that size is smaller than ->to_forward, we must update the
+ * consumed count to 1300 to flush the whole buffer, and reduce ->to_forward to
+ * 8000. After that, the producer may
  * try to feed the additional data through the invisible buffer using a
  * platform-specific method such as splice().
  *
@@ -291,15 +294,16 @@ struct channel {
  * buf->size - global.maxrewrite + ->to_forward.
  *
  * A buffer may contain up to 5 areas :
- *   - the data waiting to be sent. These data are located between buf->p-o and
- *     buf->p ;
- *   - the data to process and possibly transform. These data start at
- *     buf->p and may be up to ->i bytes long.
- *   - the data to preserve. They start at ->p and stop at ->p+i. The limit
- *     between the two solely depends on the protocol being analysed.
+ *   - the data already consumed (acknowledged). These data are located between
+ *     b_lim(b) and b_head(b) ;
+ *   - the data available to process and possibly transform. These data start at
+ *     b_head(b) and may be up to b_data(b) bytes long.
+ *   - the data to preserve. They start at b_head(b) and stop at
+ *     b_lim(b) + b_data(b). The limit between the two solely depends on the
+ *     protocol being analysed.
  *   - the spare area : it is the remainder of the buffer, which can be used to
- *     store new incoming data. It starts at ->p+i and is up to ->size-i-o long.
- *     It may be limited by global.maxrewrite.
+ *     store new incoming data. It starts at b_lim(b) + b_data(b) and is up to
+ *     b->size - b_data(b) long. It may be limited by global.maxrewrite.
  *   - the reserved area : this is the area which must not be filled and is
  *     reserved for possible rewrites ; it is up to global.maxrewrite bytes
  *     long.
index 6b8e793dcd23cde97c4a77ea0edbc5951ccc3698..6dfb6c80e0ba3928da8f03204266844ba71ebda9 100644 (file)
@@ -808,7 +808,7 @@ static inline size_t channel_data(const struct channel *chn)
        return (IS_HTX_STRM(chn_strm(chn)) ? htx_used_space(htxbuf(&chn->buf)) : c_data(chn));
 }
 
-/* Returns the amount of input data in a channel, taking he HTX streams into
+/* Returns the amount of input data in a channel, taking the HTX streams into
  * account. This function relies on channel_data().
  */
 static inline size_t channel_input_data(const struct channel *chn)
@@ -816,7 +816,7 @@ static inline size_t channel_input_data(const struct channel *chn)
        return channel_data(chn) - co_data(chn);
 }
 
-/* Returns 1 if the channel is empty, taking he HTX streams into account */
+/* Returns 1 if the channel is empty, taking the HTX streams into account */
 static inline size_t channel_empty(const struct channel *chn)
 {
        return (IS_HTX_STRM(chn) ? htx_is_empty(htxbuf(&chn->buf)) : c_empty(chn));
@@ -861,7 +861,7 @@ static inline void channel_check_xfer(struct channel *chn, size_t xferred)
                        chn->flags &= ~(CF_STREAMER | CF_STREAMER_FAST);
                }
                else if (chn->xfer_small >= 2) {
-                       /* if the buffer has been at least half full twchne,
+                       /* if the buffer has been at least half full times,
                         * we receive faster than we send, so at least it
                         * is not a "fast streamer".
                         */
index f2d804750dab678340100cffbf1c6e3021f8c568..19e20fc3d38a41f26dd606b5848ddf7cf42ac053 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * include/haproxy/filteers-t.h
+ * include/haproxy/filters-t.h
  * This file defines everything related to stream filters.
  *
  * Copyright (C) 2015 Qualys Inc., Christopher Faulet <cfaulet@qualys.com>
index 6a5b91e1a3922ed8e5b4268ccb955e1947e523e3..ddd210ae2adbaf7a4b46d7ecc8cec6bd29a19626 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * include/haproxy/http_htx-t.h
+ * include/haproxy/http_htx.h
  * This file defines function prototypes for HTTP manipulation using the
  * internal representation.
  *
index 3d4ecb7fe41c86be0c7a8b07c4e94198aaae91e3..2b53e03d8d11a40dff1138c4751bdea040393057 100644 (file)
  */
 #define HTX_SL_F_NONE           0x00000000
 #define HTX_SL_F_IS_RESP        0x00000001 /* It is the response start-line (unset means the request one) */
-#define HTX_SL_F_XFER_LEN       0x00000002 /* The message xfer size can be dertermined */
+#define HTX_SL_F_XFER_LEN       0x00000002 /* The message xfer size can be determined */
 #define HTX_SL_F_XFER_ENC       0x00000004 /* The transfer-encoding header was found in message */
 #define HTX_SL_F_CLEN           0x00000008 /* The content-length header was found in message */
 #define HTX_SL_F_CHNK           0x00000010 /* The message payload is chunked */
 #define HTX_SL_F_HAS_AUTHORITY  0x00000400 /* The request authority is explicitly specified */
 #define HTX_SL_F_NORMALIZED_URI 0x00000800 /* The received URI is normalized (an implicit absolute-uri form) */
 #define HTX_SL_F_CONN_UPG       0x00001000 /* The message contains "connection: upgrade" header */
-#define HTX_SL_F_BODYLESS_RESP  0x00002000 /* The response to this message is bodyloess (only for reqyest) */
+#define HTX_SL_F_BODYLESS_RESP  0x00002000 /* The response to this message is bodyloess (only for request) */
 #define HTX_SL_F_NOT_HTTP       0x00004000 /* Not an HTTP message (e.g "RTSP", only possible if invalid message are accepted) */
 
 /* This function is used to report flags in debugging tools. Please reflect
index 067d515c9108f5201147356a4343daf9dbf29f6a..883bba59723e63e0dda271adc69138fbb19375a1 100644 (file)
@@ -826,7 +826,7 @@ static inline int get_addr_len(const struct sockaddr_storage *addr)
        return 0;
 }
 
-/* set port in host byte order */
+/* set port in network byte order (use htons() before calling) */
 static inline int set_net_port(struct sockaddr_storage *addr, int port)
 {
        switch (addr->ss_family) {
@@ -840,7 +840,7 @@ static inline int set_net_port(struct sockaddr_storage *addr, int port)
        return 0;
 }
 
-/* set port in network byte order */
+/* set port in host byte order */
 static inline int set_host_port(struct sockaddr_storage *addr, int port)
 {
        switch (addr->ss_family) {
index 491c1c8776e6acc9ac58b2ea65d5fa59bb13791b..58659a49ffaab038b12653794d84cef813fae6ce 100644 (file)
@@ -77,7 +77,7 @@ void cfg_free_cond_term(struct cfg_cond_term *term)
  * cfg_free_cond_term(). An error will be set in <err> on error, and only
  * in this case. In this case the first bad character will be reported in
  * <errptr>. <maxdepth> corresponds to the maximum recursion depth permitted,
- * it is decremented on each recursive call and the parsing will fail one
+ * it is decremented on each recursive call and the parsing will fail upon
  * reaching <= 0.
  */
 int cfg_parse_cond_term(const char **text, struct cfg_cond_term **term, char **err, const char **errptr, int maxdepth)
@@ -370,11 +370,11 @@ void cfg_free_cond_expr(struct cfg_cond_expr *expr)
  * success. <expr> is filled with the parsed info, and <text> is updated on
  * success to point to the first unparsed character, or is left untouched
  * on failure. On success, the caller will have to free all lower-level
- * allocated structs using cfg_free_cond_expr(). An error will be set in
+ * allocated structs using cfg_free_cond_and(). An error will be set in
  * <err> on error, and only in this case. In this case the first bad
  * character will be reported in <errptr>. <maxdepth> corresponds to the
  * maximum recursion depth permitted, it is decremented on each recursive
- * call and the parsing will fail one reaching <= 0.
+ * call and the parsing will fail upon reaching <= 0.
  */
 int cfg_parse_cond_and(const char **text, struct cfg_cond_and **expr, char **err, const char **errptr, int maxdepth)
 {
@@ -438,7 +438,7 @@ int cfg_parse_cond_and(const char **text, struct cfg_cond_and **expr, char **err
        return ret;
 }
 
-/* Parse an indirect input text as a possible config condition term.
+/* Parse an indirect input text as a possible config condition expression.
  * Returns <0 on parsing error, 0 if the parser is desynchronized, or >0 on
  * success. <expr> is filled with the parsed info, and <text> is updated on
  * success to point to the first unparsed character, or is left untouched
@@ -447,7 +447,7 @@ int cfg_parse_cond_and(const char **text, struct cfg_cond_and **expr, char **err
  * <err> on error, and only in this case. In this case the first bad
  * character will be reported in <errptr>. <maxdepth> corresponds to the
  * maximum recursion depth permitted, it is decremented on each recursive call
- * and the parsing will fail one reaching <= 0.
+ * and the parsing will fail upon reaching <= 0.
  */
 int cfg_parse_cond_expr(const char **text, struct cfg_cond_expr **expr, char **err, const char **errptr, int maxdepth)
 {
@@ -511,7 +511,7 @@ int cfg_parse_cond_expr(const char **text, struct cfg_cond_expr **expr, char **e
        return ret;
 }
 
-/* evaluate an sub-expression on a .if/.elif line. The expression is valid and
+/* evaluate a sub-expression on a .if/.elif line. The expression is valid and
  * was already parsed in <expr>. Returns -1 on error (in which case err is
  * filled with a message, and only in this case), 0 if the condition is false,
  * 1 if it's true.
@@ -544,7 +544,7 @@ int cfg_eval_cond_expr(struct cfg_cond_expr *expr, char **err)
 }
 
 /* evaluate a condition on a .if/.elif line. The condition is already tokenized
- * in <err>. Returns -1 on error (in which case err is filled with a message,
+ * in <args>. Returns -1 on error (in which case err is filled with a message,
  * and only in this case), 0 if the condition is false, 1 if it's true. If
  * <errptr> is not NULL, it's set to the first invalid character on error.
  */
index 972aad9429f075792b2277934d22dda9b01d1c8e..b4ac93ba76067fdeb78fbddf80a5863f65d4e550 100644 (file)
@@ -54,7 +54,7 @@ unsigned long long __channel_forward(struct channel *chn, unsigned long long byt
        if (!budget)
                return forwarded;
 
-       /* Now we must ensure chn->to_forward sats below CHN_INFINITE_FORWARD,
+       /* Now we must ensure chn->to_forward stays below CHN_INFINITE_FORWARD,
         * which also implies it won't overflow. It's less operations in 64-bit.
         */
        bytes = (unsigned long long)chn->to_forward + budget;
@@ -105,7 +105,7 @@ int co_inject(struct channel *chn, const char *msg, int len)
  * controls. The chn->o and to_forward pointers are updated. If the channel
  * input is closed, -2 is returned. If there is not enough room left in the
  * buffer, -1 is returned. Otherwise the number of bytes copied is returned
- * (1). Channel flag READ_PARTIAL is updated if some data can be transferred.
+ * (1). Channel flag CF_READ_EVENT is set if some data can be transferred.
  */
 int ci_putchr(struct channel *chn, char c)
 {
@@ -134,7 +134,7 @@ int ci_putchr(struct channel *chn, char c)
  * input is closed, -2 is returned. If the block is too large for this buffer,
  * -3 is returned. If there is not enough room left in the buffer, -1 is
  * returned. Otherwise the number of bytes copied is returned (0 being a valid
- * number). Channel flag READ_PARTIAL is updated if some data can be
+ * number). Channel flag CF_READ_EVENT is set if some data can be
  * transferred.
  */
 int ci_putblk(struct channel *chn, const char *blk, int len)
index 8de0305a0b01907c9789c02438a0579dc20d3db4..9e640f47785430fc002d91fc21f644068d8a8197 100644 (file)
@@ -767,8 +767,8 @@ static int
 htx_compression_buffer_init(struct htx *htx, struct buffer *out)
 {
        /* output stream requires at least 10 bytes for the gzip header, plus
-        * at least 8 bytes for the gzip trailer (crc+len), plus a possible
-        * plus at most 5 bytes per 32kB block and 2 bytes to close the stream.
+        * at least 8 bytes for the gzip trailer (crc+len), plus at most
+        * 5 bytes per 32kB block and 2 bytes to close the stream.
         */
        if (htx_free_space(htx) < 20 + 5 * ((htx->data + 32767) >> 15))
                return -1;
index b49967cbdb457daa36de926c8ae8ac378cfbed98..fbe529866736a9433cc0d6278d0edf218fb7d604 100644 (file)
@@ -4827,7 +4827,7 @@ struct http_reply *http_error_message(struct stream *s)
 }
 
 /* Produces an HTX message from an http reply. Depending on the http reply type,
- * a, errorfile, an raw file or a log-format string is used. On success, it
+ * an errorfile, a raw file or a log-format string is used. On success, it
  * returns 0. If an error occurs -1 is returned. If it fails, this function only
  * exits. It is the caller responsibility to do the cleanup.
  */
index 3584f9ffb88ff3cfc3ec0798c88052be0798d7c9..aedf7a4837d3dc244477e82adfcc239c34cde7e1 100644 (file)
--- a/src/htx.c
+++ b/src/htx.c
@@ -167,7 +167,7 @@ static struct htx_blk *htx_reserve_nxblk(struct htx *htx, uint32_t blksz)
        /* Find the block's position. First, we try to get the next position in
         * the message, increasing the tail by one. If this position is not
         * available with some holes, we try to defrag the blocks without
-        * touching their paylood. If it is impossible, we fully defrag the
+        * touching their payload. If it is impossible, we fully defrag the
         * message.
         */
        tail = htx->tail + 1;
@@ -1358,7 +1358,7 @@ struct buffer *__htx_xfer_to_small_buffer(struct buffer *dst, struct buffer *src
 }
 
 /* If possible, transfer HTX blocks from <src> to a large buffer. This function
- * allocate the small buffer and makes <dst> point on it. If <dst> is not empty
+ * allocates the large buffer and makes <dst> point on it. If <dst> is not empty
  * or if <src> contains to many data, NULL is returned. If the allocation
  * failed, NULL is returned. Otherwise <dst> is returned.  <flags> instructs how
  * the transfer must be performed.
index 7abbbbf0cf7226245b227010b8ee8945b6a33548..8e2f04a7ea2197ad05ea0546cf99b2bfa9d1cdf1 100644 (file)
@@ -144,7 +144,7 @@ const uint64_t mqtt_fields_per_packet[MQTT_CPT_ENTRIES] = {
 };
 
 /* Checks the first byte of a message to read the fixed header and extract the
- * packet type and flags. <parser> is supposed to point to the fix header byte.
+ * packet type and flags. <parser> is supposed to point to the fixed header byte.
  *
  * Fix header looks like:
  * +-------+-----------+-----------+-----------+---------+----------+----------+---------+------------+
index 4a367210bae5719ce9967ac2f6603433b124eaa5..f115434965e1a7ef70883e2dd96def3b61582c54 100644 (file)
@@ -1670,7 +1670,7 @@ static void h1_update_req_conn_value(struct h1s *h1s, struct h1m *h1m, struct is
 {
        struct proxy *px = h1s->h1c->px;
 
-       /* Don't update "Connection:" header in TUNNEL mode or if "Upgrage"
+       /* Don't update "Connection:" header in TUNNEL mode or if "Upgrade"
         * token is found
         */
        if (h1s->flags & H1S_F_WANT_TUN || h1m->flags & H1_MF_CONN_UPG)
@@ -1692,7 +1692,7 @@ static void h1_update_req_conn_value(struct h1s *h1s, struct h1m *h1m, struct is
 
 static void h1_update_res_conn_value(struct h1s *h1s, struct h1m *h1m, struct ist *conn_val)
 {
-       /* Don't update "Connection:" header in TUNNEL mode or if "Upgrage"
+       /* Don't update "Connection:" header in TUNNEL mode or if "Upgrade"
         * token is found
         */
        if (h1s->flags & H1S_F_WANT_TUN || h1m->flags & H1_MF_CONN_UPG)
index cb2194fb8a76afedbf2571d08b11b5eb39913b57..c9d5258c418b179554a6f6fc6c64e30f9215a04a 100644 (file)
@@ -196,7 +196,7 @@ int regex_exec_match(const struct my_regex *preg, const char *subject,
                        pmatch[i].rm_eo = matches[(i*2)+1];
                        continue;
                }
-               /* Set the unmatvh flag (-1). */
+               /* Set the unmatched flag (-1). */
                pmatch[i].rm_so = -1;
                pmatch[i].rm_eo = -1;
        }
@@ -212,7 +212,7 @@ int regex_exec_match(const struct my_regex *preg, const char *subject,
 #endif
 }
 
-/* This function apply regex. It take a "char *" ans length as input. The
+/* This function applies a regex. It takes a "char *" and length as input. The
  * <subject> can be modified during the processing. If the function doesn't
  * match, it returns false, else it returns true.
  * When it is compiled with standard POSIX regex or PCRE, this function add
@@ -280,7 +280,7 @@ int regex_exec_match2(const struct my_regex *preg, char *subject, int length,
                        pmatch[i].rm_eo = matches[(i*2)+1];
                        continue;
                }
-               /* Set the unmatvh flag (-1). */
+               /* Set the unmatched flag (-1). */
                pmatch[i].rm_so = -1;
                pmatch[i].rm_eo = -1;
        }
index 5b6a70628bcd9eed9391fdf00a8c7e408ba5f5c3..a4eda63f6448e81c36701dc289eda833b29fe879 100644 (file)
@@ -827,7 +827,7 @@ int stats_fill_sv_line(struct proxy *px, struct server *sv, int flags,
                stats_fill_sv_computestate(sv, ref, &state);
        }
 
-       /* compue time values for later use */
+       /* compute time values for later use */
        if (index == NULL || *index == ST_I_PX_QTIME ||
            *index == ST_I_PX_CTIME || *index == ST_I_PX_RTIME ||
            *index == ST_I_PX_TTIME) {