Skip to content

Commit

Permalink
Merge pull request #1792 from private-octopus/code-coverage-202411
Browse files Browse the repository at this point in the history
Remove dead code from transport.c
  • Loading branch information
huitema authored Nov 30, 2024
2 parents d0d57ac + 7bc7abb commit f6446fe
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 71 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ else()
endif()

project(picoquic
VERSION 1.1.28.6
VERSION 1.1.28.7
DESCRIPTION "picoquic library"
LANGUAGES C CXX)

Expand Down
2 changes: 1 addition & 1 deletion picoquic/picoquic.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
69 changes: 0 additions & 69 deletions picoquic/transport.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,31 +28,6 @@
#include "tls_api.h"
#include <string.h>

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;
}

uint64_t picoquic_transport_param_varint_decode(picoquic_cnx_t * cnx, uint8_t* bytes, uint64_t extension_length, int* ret)
{
uint64_t n64 = 0;
Expand All @@ -65,18 +40,6 @@ uint64_t picoquic_transport_param_varint_decode(picoquic_cnx_t * cnx, uint8_t* b
return n64;
}

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;
}

uint8_t* picoquic_transport_param_varint_encode(uint8_t* bytes, const uint8_t* bytes_max, uint64_t n64)
{
if (bytes + 1 > bytes_max) {
Expand Down Expand Up @@ -132,38 +95,6 @@ int picoquic_transport_param_cid_decode(picoquic_cnx_t * cnx, uint8_t* bytes, ui
return ret;
}

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;
}

uint8_t * picoquic_encode_transport_param_prefered_address(uint8_t * bytes, uint8_t * bytes_max,
picoquic_tp_prefered_address_t * prefered_address)
{
Expand Down

0 comments on commit f6446fe

Please sign in to comment.