aboutsummaryrefslogtreecommitdiffstats
path: root/libtransport/src/core/tcp_socket_connector.cc
diff options
context:
space:
mode:
Diffstat (limited to 'libtransport/src/core/tcp_socket_connector.cc')
-rw-r--r--libtransport/src/core/tcp_socket_connector.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/libtransport/src/core/tcp_socket_connector.cc b/libtransport/src/core/tcp_socket_connector.cc
index 20b3d6c..f38bd2b 100644
--- a/libtransport/src/core/tcp_socket_connector.cc
+++ b/libtransport/src/core/tcp_socket_connector.cc
@@ -33,6 +33,8 @@ namespace {
class NetworkMessage {
public:
static constexpr std::size_t fixed_header_length = 10;
+ static constexpr std::uint8_t ccnx_flag = 102;
+ static constexpr std::size_t ccnx_packet_length = 44;
static std::size_t decodeHeader(const uint8_t *packet) {
// General checks
@@ -40,9 +42,9 @@ class NetworkMessage {
uint8_t first_byte = packet[0];
uint8_t ip_format = (packet[0] & 0xf0) >> 4;
- if (TRANSPORT_EXPECT_FALSE(first_byte == 102)) {
+ if (TRANSPORT_EXPECT_FALSE(first_byte == ccnx_flag)) {
// Get packet length
- return 44;
+ return ccnx_packet_length;
} else if (TRANSPORT_EXPECT_TRUE(ip_format == 6 || ip_format == 4)) {
Packet::Format format = Packet::getFormatFromBuffer(packet);
return Packet::getHeaderSizeFromBuffer(format, packet) +