Driver: Minor refactor

This commit is contained in:
Nodir Temirkhodjaev 2022-08-12 12:39:19 +05:00
parent 73c7ecc2f6
commit f5ef18d6a4
2 changed files with 6 additions and 7 deletions

View File

@ -431,8 +431,8 @@ static void fort_callout_stream_classify(const FWPS_INCOMING_VALUES0 *inFixedVal
fort_callout_flow_classify(inMetaValues, flowContext, classifyOut, dataSize, isIPv6,
/*is_tcp=*/TRUE, inbound);
/* Flush flow's deferred TCP packets on FIN */
#if 0
/* Flush flow's deferred TCP packets on FIN */
if (streamFlags & (FWPS_STREAM_FLAG_RECEIVE_DISCONNECT | FWPS_STREAM_FLAG_SEND_DISCONNECT)) {
PFORT_FLOW flow = (PFORT_FLOW) flowContext;

View File

@ -425,11 +425,10 @@ static void fort_flow_speed_limit(PFORT_STAT stat, PFORT_FLOW flow, const FORT_F
/* Add traffic to app. group */
*group_bytes += data_len;
const BOOL defer_flow = (*group_bytes >= limit_bytes);
/* Defer ACK */
{
const UCHAR defer_flag = inbound ? FORT_FLOW_DEFER_OUT : FORT_FLOW_DEFER_IN;
const BOOL defer_flow = (*group_bytes >= limit_bytes);
fort_flow_flags_set(flow, defer_flag, defer_flow);
}
@ -560,12 +559,12 @@ FORT_API UINT32 fort_stat_dpc_group_flush(PFORT_STAT stat)
traf = group->traf;
// Inbound
fort_stat_group_flush_limit_bytes(
&defer_flush_bits, &flush_bit, &traf.in_bytes, group_limit->in_bytes, i, 1, 1);
fort_stat_group_flush_limit_bytes(&defer_flush_bits, &flush_bit, &traf.in_bytes,
group_limit->in_bytes, /*group_index=*/i, /*flush_index=*/1, /*defer_offset=*/1);
// Outbound
fort_stat_group_flush_limit_bytes(
&defer_flush_bits, &flush_bit, &traf.out_bytes, group_limit->out_bytes, i, 2, 0);
fort_stat_group_flush_limit_bytes(&defer_flush_bits, &flush_bit, &traf.out_bytes,
group_limit->out_bytes, /*group_index=*/i, /*flush_index=*/2, /*defer_offset=*/0);
// Adjust flushed bytes
group->traf = traf;