Skip to content

Commit

Permalink
brust and delete log
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidAlphaFox committed Oct 4, 2021
1 parent 6b36a96 commit 765948c
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 9 deletions.
2 changes: 1 addition & 1 deletion include/aiutp.hrl
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@
% per 5 seconds
ssthresh = ?OUTGOING_BUFFER_MAX_SIZE * ?PACKET_SIZE,
slow_start = true,
brust = fasle,
brust = true,
inbuf,
outbuf,
inque,
Expand Down
4 changes: 2 additions & 2 deletions src/aiutp_net.erl
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,9 @@ send_ack(#aiutp_pcb{time = Now,
PCB#aiutp_pcb{last_sent_packet = Now,last_rcv_win = WindowSize}.


send_keep_alive(#aiutp_pcb{ack_nr = AckNR} = PCB)->
send_keep_alive(#aiutp_pcb{conn_id_recv = ConnId,ack_nr = AckNR} = PCB)->
PCB0 = send_ack(PCB#aiutp_pcb{ack_nr = aiutp_util:bit16(AckNR -1)}),
io:format("send keep alive: ~p~n",[AckNR]),
io:format("ConnId:~p send keep alive: ~p~n",[ConnId,AckNR]),
PCB0#aiutp_pcb{ack_nr = AckNR}.

update_wrap_packet(MicroNow,ReplyMicro,WindowSize,AckNR,WrapPacket)->
Expand Down
6 changes: 0 additions & 6 deletions src/aiutp_pcb.erl
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@ process(_,
if ((PktType /= ?ST_SYN) or (State /= ?CS_SYN_RECV)) and
(?WRAPPING_DIFF_16(MaxSeqNR,PktAckNR) < 0) or
(?WRAPPING_DIFF_16(PktAckNR, MinSeqNR) < 0) ->
io:format("ConnId: ~p drop packet in process PktSeqNR: ~p PktAckNR: ~p ~n ",[ConnId,PktSeqNR,PktAckNR]),
PCB;
% ignore packets whose ack_nr is invalid. This would imply a spoofed address
% or a malicious attempt to attach the uTP implementation.
Expand All @@ -121,10 +120,6 @@ process(_,
process_packet(#aiutp_packet{type = PktType,seq_nr = PktSeqNR,conn_id = ConnId,ack_nr = PktAckNR} = Packet,
#aiutp_pcb{state = State} = PCB)->
Now = aiutp_util:millisecond(),
if PktType == ?ST_DATA ->
io:format("ConnId: ~p recv packet PktSeqNR: ~p PktAckNR: ~p~n",[ConnId,PktSeqNR,PktAckNR]);
true -> ok
end,
PCB0 =
if State == ?CS_SYN_SENT ->
% if this is a syn-ack, initialize our ack_nr
Expand All @@ -141,7 +136,6 @@ process_packet(#aiutp_packet{type = PktType,seq_nr = PktSeqNR,conn_id = ConnId,a
% current. Subtracring 1 makes 0 mean "this is the next
% expected packet".
if SeqDistance >= ?REORDER_BUFFER_MAX_SIZE ->
io:format("ConnId: ~p drop packet in process_packet PktSeqNR: ~p PktAckNR: ~p ~n ",[ConnId,PktSeqNR,PktAckNR]),
if (SeqDistance >= (?SEQ_NR_MASK + 1 - ?REORDER_BUFFER_MAX_SIZE)) and
(PktType /= ?ST_STATE) -> PCB0#aiutp_pcb{ida = true};
true -> PCB0
Expand Down

0 comments on commit 765948c

Please sign in to comment.