]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
CLEANUP: quic: Rename <buf> variable into quic_padding_check()
authorFrédéric Lécaille <flecaille@haproxy.com>
Mon, 24 Apr 2023 12:38:33 +0000 (14:38 +0200)
committerFrédéric Lécaille <flecaille@haproxy.com>
Mon, 24 Apr 2023 13:53:26 +0000 (15:53 +0200)
Make quic_padding_check() be more readable: there is not struct buffer variable
used by this function.

Should be backported to 2.7.

src/quic_conn.c

index 399f22f349427c3fa3ffeda29ef5073d72e6f32f..6f0827525da260d0d4a94d136753aed599bde640 100644 (file)
@@ -6749,18 +6749,18 @@ static int qc_conn_alloc_ssl_ctx(struct quic_conn *qc)
        goto leave;
 }
 
-/* Check that all the bytes between <buf> included and <end> address
+/* Check that all the bytes between <pos> included and <end> address
  * excluded are null. This is the responsibility of the caller to
- * check that there is at least one byte between <buf> end <end>.
+ * check that there is at least one byte between <pos> end <end>.
  * Return 1 if this all the bytes are null, 0 if not.
  */
-static inline int quic_padding_check(const unsigned char *buf,
+static inline int quic_padding_check(const unsigned char *pos,
                                      const unsigned char *end)
 {
-       while (buf < end && !*buf)
-               buf++;
+       while (pos < end && !*pos)
+               pos++;
 
-       return buf == end;
+       return pos == end;
 }
 
 /* Find the associated connection to the packet <pkt> or create a new one if