]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: quic: fix documentation for transport params decoding
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Wed, 1 Apr 2026 11:10:21 +0000 (13:10 +0200)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Thu, 2 Apr 2026 12:02:04 +0000 (14:02 +0200)
The documentation for functions related to transport parameters decoding
is unclear or sometimes completely wrong on the meaning of the <server>
argument. It must be set to reflect the origin of the parameters,
contrary to what was implied in function comments.

Fix this by rewriting comments related to this <server> argument. This
should prevent to make any mistake in the future.

This is purely a documentation fix. However, it could be useful to
backport it up to 2.6.

src/quic_tp.c

index 309411af03e943a24a023c049eabb2dd3e197b72..ec2e9d5df6498adc6320f979ac6105ab6ff374b9 100644 (file)
@@ -256,9 +256,8 @@ static int quic_transport_param_dec_version_info(struct tp_version_information *
 }
 
 /* Decode into <p> struct a transport parameter found in <*buf> buffer with
- * <type> as type and <len> as length, depending on <server> boolean value which
- * must be set to 1 for a server (haproxy listener) or 0 for a client (connection
- * to an haproxy server).
+ * <type> as type and <len> as length. The boolean argument <server> must be
+ * set according to the origin of the parameters.
  */
 static enum quic_tp_dec_err
 quic_transport_param_decode(struct quic_transport_params *p, int server,
@@ -675,9 +674,8 @@ int quic_transport_params_encode(unsigned char *buf,
        return pos - head;
 }
 
-/* Decode transport parameters found in <buf> buffer into <p>, depending on
- * <server> boolean value which must be set to 1 for a server (haproxy listener)
- * or 0 for a client (connection to a haproxy server).
+/* Decode transport parameters found in <buf> buffer into <p>. The boolean
+ * argument <server> must be set according to the origin of the parameters.
  * Returns 1 if succeeded, 0 if not.
  */
 static enum quic_tp_dec_err
@@ -729,9 +727,10 @@ quic_transport_params_decode(struct quic_transport_params *p, int server,
        return QUIC_TP_DEC_ERR_NONE;
 }
 
-/* Store transport parameters found in <buf> buffer into <qc> QUIC connection
- * depending on <server> value which must be 1 for a server (haproxy listener)
- * or 0 for a client (connection to a haproxy server).
+/* Store transport parameters found in <buf> buffer into <qc> QUIC connection.
+ * The boolean argument <server> must be set according to the origin of the
+ * parameters.
+ *
  * Note that peer transport parameters are stored in the TX part of the connection:
  * they are used to send packets to the peer with its transport parameters as
  * limitations.