Rename `cmp_cid` to `cid_is_equal`
`cmp_*` may (incorrectly) imply that it could be used for comparison
for a sorting function. This renaming clarifies that this function
is solely for equivalent test.
@@ -4794,7 +4794,7 @@ static void store_spare_cid(struct st_quicly_spare_cid_t *spare_cid, const quicl
/**
* compares CIDs, returns zero if identical
*/
-static int cmp_cid(const quicly_cid_t *l, ptls_iovec_t r)
+static int cid_is_equal(const quicly_cid_t *l, ptls_iovec_t r)
{
if (l->len != r.len)
return 1;
@@ -4859,7 +4859,7 @@ static int handle_new_connection_id_frame(quicly_conn_t *conn, struct st_quicly_
* different connection IDs, the endpoint MAY treat that receipt as a connection error of type PROTOCOL_VIOLATION.
* (19.15)
*/
- if (cmp_cid(&spare_cid->cid, frame.cid) == 0) {
+ if (cid_is_equal(&spare_cid->cid, frame.cid) == 0) {
if (spare_cid->sequence == frame.sequence &&
memcmp(spare_cid->stateless_reset_token, frame.stateless_reset_token, QUICLY_STATELESS_RESET_TOKEN_LEN) == 0) {
/* likely a duplicate due to retransmission */
@@ -4869,7 +4869,7 @@ static int handle_new_connection_id_frame(quicly_conn_t *conn, struct st_quicly_
return QUICLY_TRANSPORT_ERROR_PROTOCOL_VIOLATION;
}
}
- if (spare_cid->sequence == frame.sequence && cmp_cid(&spare_cid->cid, frame.cid) != 0)
+ if (spare_cid->sequence == frame.sequence && cid_is_equal(&spare_cid->cid, frame.cid) != 0)
return QUICLY_TRANSPORT_ERROR_PROTOCOL_VIOLATION;
continue;
