]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
CLEANUP: tree-wide: fix more typos and outdated explanations in comments
authorWilly Tarreau <w@1wt.eu>
Wed, 13 May 2026 08:48:18 +0000 (10:48 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 13 May 2026 09:24:27 +0000 (11:24 +0200)
Some outdated comments, as well as typos were fixed in the following files:

  dgram.h protocol.h queue-t.h cpu_topo.c debug.c dict.c
  protocol.c queue.c raw_sock.c trace.c wdt.c

include/haproxy/dgram.h
include/haproxy/protocol.h
include/haproxy/queue-t.h
src/cpu_topo.c
src/debug.c
src/dict.c
src/protocol.c
src/queue.c
src/raw_sock.c
src/trace.c
src/wdt.c

index 92d00ab11aca5c75fcb22cbac09e85dd7d3b42af..20816d019e907aa7d9551c2d9fc2fb5ac1a7f209 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * include/haproxy/proto_dgram.h
+ * include/haproxy/dgram.h
  * This file provides functions related to DGRAM processing.
  *
  * Copyright (C) 2014 Baptiste Assmann <bedis9@gmail.com>
index beb0632e37951881121e1c098e029dd5a4ca3427..45e96ee511d824a119fd848cca2e6093d98a57e2 100644 (file)
@@ -92,8 +92,8 @@ int protocol_resume_all(void);
 int protocol_enable_all(void);
 
 /* returns the protocol associated to family <family> with proto_type among the
- * supported protocol types, and ctrl_type of either SOCK_STREAM or SOCK_DGRAM
- * depending on the requested values, or NULL if not found.
+ * supported protocol types, and index <alt> (0 or 1) selecting between the two
+ * possible entries per (family, proto_type), or NULL if not found.
  */
 static inline struct protocol *protocol_lookup(int family, enum proto_type proto_type, int alt)
 {
index 7d9c31cf84f8fc16c5a127924acff49c331c8790..bcb3ae398cf6fce4bb6538bc3f789805211ae382 100644 (file)
@@ -42,7 +42,7 @@ struct pendconn {
 };
 
 struct queue {
-       struct eb_root head;                    /* queued pendconnds */
+       struct eb_root head;                    /* queued pendconns */
        struct proxy  *px;                      /* the proxy we're waiting for, never NULL in queue */
        struct server *sv;                      /* the server we are waiting for, may be NULL if don't care */
        __decl_thread(HA_SPINLOCK_T lock);      /* for manipulations in the tree */
index 8cd7c73a49f489f7edc8891e3fe9560baf831155..bfb7177cd217952405c52cad530cabe912b3fa02 100644 (file)
@@ -983,7 +983,7 @@ void cpu_compose_clusters(void)
                /* renumber clusters and assign unassigned ones at the same
                 * time. For this, we'll compare pkg/die/llc with the last
                 * CPU's and verify if we need to create a new cluster ID.
-                * Note that some platforms don't report cache. The locao value
+                * Note that some platforms don't report cache. The local value
                 * is local to the pkg+node combination so that we reset it
                 * when changing, contrary to the global one which grows.
                 */
@@ -2402,7 +2402,7 @@ static int cpu_topo_alloc(void)
                ha_cpu_clusters[cpu].idx = cpu;
        }
 
-       /* pre-inizialize the configured CPU sets */
+       /* pre-initialize the configured CPU sets */
        ha_cpuset_zero(&cpu_set_cfg.drop_cpus);
        ha_cpuset_zero(&cpu_set_cfg.only_cpus);
        ha_cpuset_zero(&cpu_set_cfg.drop_nodes);
index 50a8856dcbde28f346e6f4a792d9ed26d2b5e297..cdb98584c42403eace1013ef335d3664235178ba 100644 (file)
@@ -1357,8 +1357,7 @@ static int debug_parse_cli_write(char **args, char *payload, struct appctx *appc
 /*
  *  debug dev stream [strm=<ptr>] [strm.f[{+-=}<flags>]] [txn.f[{+-=}<flags>]] \
  *                   [req.f[{+-=}<flags>]] [res.f[{+-=}<flags>]]               \
- *                   [sif.f[{+-=<flags>]] [sib.f[{+-=<flags>]]                 \
- *                   [sif.s[=<state>]] [sib.s[=<state>]]
+ *                   [scf.s[=<state>]] [scb.s[=<state>]]
  */
 static int debug_parse_cli_stream(char **args, char *payload, struct appctx *appctx, void *private)
 {
@@ -1628,7 +1627,7 @@ static struct task *debug_delay_inj_task(struct task *t, void *ctx, unsigned int
  */
 static int debug_parse_delay_inj(char **args, char *payload, struct appctx *appctx, void *private)
 {
-       unsigned long *tctx; // [0] = inter, [2] = count
+       unsigned long *tctx; // [0] = inter, [1] = nbwakeups
        struct task *task;
 
        if (!cli_has_level(appctx, ACCESS_LVL_ADMIN))
index a22508148dc2143d72a9a600bbf686bbd84b8824..61751eb1ee686f4531334e3e221ada45b4609250 100644 (file)
@@ -59,7 +59,7 @@ static void free_dict_entry(struct dict_entry *de)
 }
 
 /*
- * Simple function to lookup dictionary entries with <s> as value.
+ * Simple function to lookup dictionary entries with <s> as key.
  */
 static struct dict_entry *__dict_lookup(struct dict *d, const char *s)
 {
@@ -75,7 +75,7 @@ static struct dict_entry *__dict_lookup(struct dict *d, const char *s)
 }
 
 /*
- * Insert an entry in <d> dictionary with <s> as value. *
+ * Insert an entry in <d> dictionary with <s> as key.
  */
 struct dict_entry *dict_insert(struct dict *d, char *s)
 {
index b42346090e1d59d8d3a08065f9dbd331a83b5b5b..fe91656ba61ac07ac6f467860456c4dbedab9267 100644 (file)
@@ -106,7 +106,7 @@ int protocol_supports_flag(struct protocol *proto, uint flag)
                if (!(_HA_ATOMIC_LOAD(&proto->flags) & PROTO_F_REUSEPORT_SUPPORTED))
                        return 0;
 
-               /* at least nobody said it was not supported */
+               /* TESTED is set, assume supported (live test already ran and passed) */
                if (_HA_ATOMIC_LOAD(&proto->flags) & PROTO_F_REUSEPORT_TESTED)
                        return 1;
 
@@ -289,8 +289,7 @@ int protocol_resume_all(void)
 }
 
 /* enables all listeners of all registered protocols. This is intended to be
- * used after a fork() to enable reading on all file descriptors. Returns
- * composition of ERR_NONE.
+ * used after a fork() to enable reading on all file descriptors. Returns ERR_NONE.
  */
 int protocol_enable_all(void)
 {
index 59d52771ef25c918f0371d1f37bf228d3b8b1e7f..acd7f6489ce72c807fab4e1410c4e9d9f474eb86 100644 (file)
@@ -24,9 +24,9 @@
  *   - if p->node.node.leaf_p is NULL, the element is unlinked,
  *     otherwise it necessarily belongs to one of the other lists ; this may
  *     not be atomically checked under threads though ;
- *   - pendconn->px is never NULL if pendconn->list is not empty
- *   - pendconn->srv is never NULL if pendconn->list is in the server's queue,
- *     and is always NULL if pendconn->list is in the backend's queue or empty.
+ *   - pendconn->queue->px is never NULL if pendconn->node.node.leaf_p is not NULL
+ *   - pendconn->queue->sv is never NULL if pendconn is in the server's queue,
+ *     and is always NULL if it is in the proxy's queue or unlinked.
  *   - pendconn->target is NULL while the element is queued, and points to the
  *     assigned server when the pendconn is picked.
  *
@@ -44,7 +44,7 @@
  *   - a pendconn_add() is only performed by the stream which will own the
  *     pendconn ; the pendconn is allocated at this moment and returned ; it is
  *     added to either the server or the proxy's queue while holding this
-s *     queue's lock.
+ *     queue's lock.
  *
  *   - the pendconn is then met by a thread walking over the proxy or server's
  *     queue with the respective lock held. This lock is exclusive and the
@@ -59,7 +59,7 @@ s *     queue's lock.
  *     on the queue the pendconn is attached to.
  *
  *   - no single operation except the pendconn initialisation prior to the
- *     insertion are performed without eithre a queue lock held or the element
+ *     insertion are performed without either a queue lock held or the element
  *     being unlinked and visible exclusively to its stream.
  *
  *   - pendconn_process_next_strm() assign ->target so that the stream knows
@@ -126,7 +126,8 @@ unsigned int srv_dynamic_maxconn(const struct server *s)
  * up to the caller to atomically decrement the pending counts.
  *
  * The caller must own the lock on the server queue. The pendconn must still be
- * queued (p->node.leaf_p != NULL) and must be in a server (p->srv != NULL).
+ * queued (p->node.node.leaf_p != NULL) and must be in a server queue
+ * (p->queue->sv != NULL).
  */
 static void __pendconn_unlink_srv(struct pendconn *p)
 {
@@ -139,7 +140,8 @@ static void __pendconn_unlink_srv(struct pendconn *p)
  * up to the caller to atomically decrement the pending counts.
  *
  * The caller must own the lock on the proxy queue. The pendconn must still be
- * queued (p->node.leaf_p != NULL) and must be in the proxy (p->srv == NULL).
+ * queued (p->node.node.leaf_p != NULL) and must be in the proxy queue
+ * (p->queue->sv == NULL).
  */
 static void __pendconn_unlink_prx(struct pendconn *p)
 {
@@ -147,18 +149,18 @@ static void __pendconn_unlink_prx(struct pendconn *p)
        eb32_delete(&p->node);
 }
 
-/* Locks the queue the pendconn element belongs to. This relies on both p->px
- * and p->srv to be properly initialized (which is always the case once the
- * element has been added).
+/* Locks the queue the pendconn element belongs to. This relies on p->queue
+ * being properly initialized (which is always the case once the element
+ * has been added).
  */
 static inline void pendconn_queue_lock(struct pendconn *p)
 {
        HA_SPIN_LOCK(QUEUE_LOCK, &p->queue->lock);
 }
 
-/* Unlocks the queue the pendconn element belongs to. This relies on both p->px
- * and p->srv to be properly initialized (which is always the case once the
- * element has been added).
+/* Unlocks the queue the pendconn element belongs to. This relies on p->queue
+ * being properly initialized (which is always the case once the element
+ * has been added).
  */
 static inline void pendconn_queue_unlock(struct pendconn *p)
 {
index eebdf8be8fdc26ece736638b260f95b60d5c7a9f..33fb8f5c348bad7ea39d1ffdb032736080c0ef05 100644 (file)
@@ -365,7 +365,7 @@ static size_t raw_sock_to_buf(struct connection *conn, void *xprt_ctx, struct bu
        if (unlikely((flags & CO_RFL_TRY_HARDER) &&
                     !(conn->flags & CO_FL_SOCK_RD_SH) &&
                     !count)) {
-               /* we've read exactly what was being asked for, which is loewr
+               /* we've read exactly what was being asked for, which is lower
                 * than a full buffer, and the caller wants us to really check
                 * if there's something after. This happens in the context of
                 * SSL where the lib reads in tiny chunks without offering the
index 303b3e690802963a6d32ce556ca9f7f5acb50f4e..68e98bbc4ef280b3289972e480d45b2617119b67 100644 (file)
@@ -1188,7 +1188,7 @@ void trace_parse_cmds(void)
        }
 }
 
-/* parse a "trace" statement in the "global" section, returns 1 if a message is returned, otherwise zero */
+/* parse a "trace" statement in the "global" section, returns -1 on error, zero otherwise */
 static int cfg_parse_trace(char **args, int section_type, struct proxy *curpx,
                           const struct proxy *defpx, const char *file, int line,
                           char **err)
index a18745f0ff0a4c136004d0023f2c207414e91318..0d411eb5d350b2c4a05f3b64d0e8730ee8470688 100644 (file)
--- a/src/wdt.c
+++ b/src/wdt.c
@@ -258,6 +258,7 @@ int init_wdt_per_thread()
  fail1:
        per_thread_wd_ctx[tid].timer = TIMER_INVALID;
        ha_warning("Failed to setup watchdog timer for thread %u, disabling lockup detection.\n", tid);
+       /* don't fail to start just for this */
        return 1;
 }