Skip to content

Commit

Permalink
flush
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidAlphaFox committed Oct 4, 2021
1 parent f7a6bcc commit 167efec
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion include/aiutp.hrl
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
-define(KEEPALIVE_INTERVAL,29000). %ms
% 29 seconds determined from measuring many home NAT devices
-define(UTP_HEADER_SIZE,20).
-define(TIMEOUT_CHECK_INTERVAL,150).
-define(TIMEOUT_CHECK_INTERVAL,100).
-define(SEQ_NR_MASK,16#FFFF).
-define(ACK_NR_MASK,16#FFFF).
-define(TIMESTAMP_MASK, 16#FFFFFFFF).
Expand Down
8 changes: 6 additions & 2 deletions src/aiutp_pcb.erl
Original file line number Diff line number Diff line change
Expand Up @@ -432,6 +432,8 @@ check_timeouts_0(#aiutp_pcb{time =Now,
rto_timeout = RTOTimeout,
fin_sent = FinSent,
cur_window_packets = CurWindowPackets,
cur_window = CurWindow,
outbuf = OutBuf,
brust = Brust} = PCB)->
PCB0 =
if (MaxWindowUser == 0 ) and
Expand All @@ -440,12 +442,14 @@ check_timeouts_0(#aiutp_pcb{time =Now,
end,
{Continue,PCB1} =
if (Brust == false) and
(RTOTimeout >0) and
(RTOTimeout >0) and
(Now - RTOTimeout >= 0) ->
check_timeouts_1(PCB0);
(Brust == true) and
(CurWindowPackets > 0) ->
{true,aiutp_net:flush_packets(PCB)};
Iter = aiutp_buffer:head(OutBuf),
{CurWindow0,OutBuf0} = mark_need_resend(CurWindowPackets,CurWindow,Iter,OutBuf),
{true,aiutp_net:flush_packets(PCB#aiutp_pcb{cur_window = CurWindow0,outbuf = OutBuf0})};
true -> {true,PCB0}
end,
if Continue == true ->
Expand Down

0 comments on commit 167efec

Please sign in to comment.