From 7a715b32fc3c764bd4ecf733e4b8420fb98f01ee Mon Sep 17 00:00:00 2001 From: huitema Date: Fri, 29 Nov 2024 15:38:57 -0800 Subject: [PATCH 1/2] Remove dead code from transport.c --- picoquic/transport.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/picoquic/transport.c b/picoquic/transport.c index 718a70ad8..3f98ee8fe 100644 --- a/picoquic/transport.c +++ b/picoquic/transport.c @@ -27,7 +27,7 @@ #include "picoquic_unified_log.h" #include "tls_api.h" #include - +#if 0 uint8_t* picoquic_transport_param_varint_encode_old(uint8_t* bytes, const uint8_t* bytes_max, uint64_t n64) { if (bytes + 2 > bytes_max) { @@ -52,7 +52,7 @@ uint8_t* picoquic_transport_param_varint_encode_old(uint8_t* bytes, const uint8_ return bytes; } - +#endif uint64_t picoquic_transport_param_varint_decode(picoquic_cnx_t * cnx, uint8_t* bytes, uint64_t extension_length, int* ret) { uint64_t n64 = 0; @@ -64,7 +64,7 @@ uint64_t picoquic_transport_param_varint_decode(picoquic_cnx_t * cnx, uint8_t* b return n64; } - +#if 0 uint8_t* picoquic_transport_param_type_varint_encode_old(uint8_t* bytes, const uint8_t* bytes_max, picoquic_tp_enum tp_type, uint64_t n64) { if (bytes != NULL && bytes + 2 <= bytes_max) { @@ -76,6 +76,7 @@ uint8_t* picoquic_transport_param_type_varint_encode_old(uint8_t* bytes, const u } return bytes; } +#endif uint8_t* picoquic_transport_param_varint_encode(uint8_t* bytes, const uint8_t* bytes_max, uint64_t n64) { @@ -131,7 +132,7 @@ int picoquic_transport_param_cid_decode(picoquic_cnx_t * cnx, uint8_t* bytes, ui return ret; } - +#if 0 uint8_t* picoquic_encode_transport_param_prefered_address_old(uint8_t* bytes, uint8_t* bytes_max, picoquic_tp_prefered_address_t* prefered_address) { @@ -163,7 +164,7 @@ uint8_t* picoquic_encode_transport_param_prefered_address_old(uint8_t* bytes, ui return bytes; } - +#endif uint8_t * picoquic_encode_transport_param_prefered_address(uint8_t * bytes, uint8_t * bytes_max, picoquic_tp_prefered_address_t * prefered_address) { From 7bc7abb67c8764c9420013d2f5d57b555000e79d Mon Sep 17 00:00:00 2001 From: huitema Date: Fri, 29 Nov 2024 15:43:35 -0800 Subject: [PATCH 2/2] Version 1.1.28.7 --- CMakeLists.txt | 2 +- picoquic/picoquic.h | 2 +- picoquic/transport.c | 70 -------------------------------------------- 3 files changed, 2 insertions(+), 72 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5f64b0999..39411cc7b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -8,7 +8,7 @@ else() endif() project(picoquic - VERSION 1.1.28.6 + VERSION 1.1.28.7 DESCRIPTION "picoquic library" LANGUAGES C CXX) diff --git a/picoquic/picoquic.h b/picoquic/picoquic.h index 1c4ed286a..a3296b82b 100644 --- a/picoquic/picoquic.h +++ b/picoquic/picoquic.h @@ -40,7 +40,7 @@ extern "C" { #endif -#define PICOQUIC_VERSION "1.1.28.6" +#define PICOQUIC_VERSION "1.1.28.7" #define PICOQUIC_ERROR_CLASS 0x400 #define PICOQUIC_ERROR_DUPLICATE (PICOQUIC_ERROR_CLASS + 1) #define PICOQUIC_ERROR_AEAD_CHECK (PICOQUIC_ERROR_CLASS + 3) diff --git a/picoquic/transport.c b/picoquic/transport.c index 3f98ee8fe..68e3fb282 100644 --- a/picoquic/transport.c +++ b/picoquic/transport.c @@ -27,32 +27,7 @@ #include "picoquic_unified_log.h" #include "tls_api.h" #include -#if 0 -uint8_t* picoquic_transport_param_varint_encode_old(uint8_t* bytes, const uint8_t* bytes_max, uint64_t n64) -{ - if (bytes + 2 > bytes_max) { - bytes = NULL; - } - else { - uint8_t * byte_l; - size_t l; - - *bytes++ = 0; - byte_l = bytes; - *bytes++ = 0; - l = picoquic_varint_encode(bytes, bytes_max - bytes, n64); - if (l == 0) { - bytes = NULL; - } - else { - *byte_l = (uint8_t) l; - bytes += l; - } - } - return bytes; -} -#endif uint64_t picoquic_transport_param_varint_decode(picoquic_cnx_t * cnx, uint8_t* bytes, uint64_t extension_length, int* ret) { uint64_t n64 = 0; @@ -64,19 +39,6 @@ uint64_t picoquic_transport_param_varint_decode(picoquic_cnx_t * cnx, uint8_t* b return n64; } -#if 0 -uint8_t* picoquic_transport_param_type_varint_encode_old(uint8_t* bytes, const uint8_t* bytes_max, picoquic_tp_enum tp_type, uint64_t n64) -{ - if (bytes != NULL && bytes + 2 <= bytes_max) { - picoformat_16(bytes, (uint16_t)tp_type); - bytes = picoquic_transport_param_varint_encode_old(bytes + 2, bytes_max, n64); - } - else { - bytes = NULL; - } - return bytes; -} -#endif uint8_t* picoquic_transport_param_varint_encode(uint8_t* bytes, const uint8_t* bytes_max, uint64_t n64) { @@ -132,39 +94,7 @@ int picoquic_transport_param_cid_decode(picoquic_cnx_t * cnx, uint8_t* bytes, ui return ret; } -#if 0 -uint8_t* picoquic_encode_transport_param_prefered_address_old(uint8_t* bytes, uint8_t* bytes_max, - picoquic_tp_prefered_address_t* prefered_address) -{ - /* first compute the length */ - uint16_t coded_length = 4u + 2u + 16u + 2u + 1u + prefered_address->connection_id.id_len + 16u; - if (bytes == NULL || bytes + coded_length > bytes_max) { - bytes = NULL; - } - else { - picoformat_16(bytes, picoquic_tp_server_preferred_address); - bytes += 2; - picoformat_16(bytes, coded_length); - bytes += 2; - memcpy(bytes, prefered_address->ipv4Address, 4); - bytes += 4; - picoformat_16(bytes, prefered_address->ipv4Port); - bytes += 2; - memcpy(bytes, prefered_address->ipv6Address, 16); - bytes += 16; - picoformat_16(bytes, prefered_address->ipv4Port); - bytes += 2; - *bytes++ = prefered_address->connection_id.id_len; - bytes += picoquic_format_connection_id(bytes, bytes_max - bytes, - prefered_address->connection_id); - memcpy(bytes, prefered_address->statelessResetToken, 16); - bytes += 16; - } - - return bytes; -} -#endif uint8_t * picoquic_encode_transport_param_prefered_address(uint8_t * bytes, uint8_t * bytes_max, picoquic_tp_prefered_address_t * prefered_address) {