Skip to content

Commit 023f52c

Browse files
committed
Speed up tcp flow data packet processing
1 parent c579777 commit 023f52c

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

source/network/connection/flow/tcp/tcp_flow.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,10 +140,12 @@ void TcpFlow::process_data_packet(const Packet& data, PacketCallback callback) {
140140
ack.receiver_port = m_context.sender_port;
141141
ack.size = SizeByte(1);
142142
ack.ttl = M_MAX_TTL;
143-
ack.flags.set_flag(m_packet_type_label, PacketType::ACK)
144-
.log_err_if_not_present(
143+
auto exp_void = ack.flags.set_flag(m_packet_type_label, PacketType::ACK);
144+
if (!exp_void.has_value()) {
145+
LOG_ERROR(
145146
fmt::format("Flow {}: could not set type label to ack packet {}",
146147
m_id, ack.to_string()));
148+
}
147149
SizeByte data_packet_size = data.size;
148150

149151
std::shared_ptr<TcpFlow> flow = shared_from_this();

0 commit comments

Comments
 (0)