]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
CLEANUP: mqtt: fix typo in MQTT_REMAINING_LENGHT_MAX_SIZE
authorNicolas CARPi <nico-git@deltablot.email>
Tue, 27 Aug 2024 19:51:26 +0000 (21:51 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 30 Aug 2024 12:58:59 +0000 (14:58 +0200)
There was a typo in the macro name, where LENGTH was incorrectly
written. This didn't cause any issue because the typo appeared in all
occurrences in the codebase.

include/haproxy/mqtt-t.h
src/mqtt.c

index 3af2d1158bb0bdd1ca935b533c7e1c52d5bffc9d..030a29b7447ce8af2ee66356781732d0198d1ed6 100644 (file)
@@ -118,7 +118,7 @@ enum {
 
 /* MQTT minimal packet size */
 #define MQTT_MIN_PKT_SIZE              2
-#define MQTT_REMAINING_LENGHT_MAX_SIZE 4
+#define MQTT_REMAINING_LENGTH_MAX_SIZE 4
 
 /* list of supported capturable Field Names and configuration file string */
 enum {
index 5688296e52bc66152a4445d4480a0f36e8dc0410..7abbbbf0cf7226245b227010b8ee8945b6a33548 100644 (file)
@@ -238,7 +238,7 @@ static inline struct ist mqtt_read_4byte_int(struct ist parser, uint32_t *i)
  * Thus each byte encodes 128 values and a "continuation bit".
  *
  * The maximum number of bytes in the Remaining Length field is four
- * (MQTT_REMAINING_LENGHT_MAX_SIZE).
+ * (MQTT_REMAINING_LENGTH_MAX_SIZE).
  *
  * <parser> is supposed to point to the first byte of the integer. On success
  * the integer is stored in <*i> and the new parser state is returned. On
@@ -251,7 +251,7 @@ static inline struct ist mqtt_read_varint(struct ist parser, uint32_t *i)
        off = m = 0;
        if (i)
                *i = 0;
-       for (off = 0; off < MQTT_REMAINING_LENGHT_MAX_SIZE && istlen(parser); off++) {
+       for (off = 0; off < MQTT_REMAINING_LENGTH_MAX_SIZE && istlen(parser); off++) {
                uint8_t byte = (uint8_t)*istptr(parser);
 
                if (i) {
@@ -265,7 +265,7 @@ static inline struct ist mqtt_read_varint(struct ist parser, uint32_t *i)
                        break;
        }
 
-       if (off == MQTT_REMAINING_LENGHT_MAX_SIZE)
+       if (off == MQTT_REMAINING_LENGTH_MAX_SIZE)
                return IST_NULL;
        return parser;
 }