File tree Expand file tree Collapse file tree 2 files changed +7
-10
lines changed Expand file tree Collapse file tree 2 files changed +7
-10
lines changed Original file line number Diff line number Diff line change @@ -485,7 +485,9 @@ defmodule ExICE.Priv.ICEAgent do
485
485
Logger . debug ( "Setting end-of-candidates flag." )
486
486
ice_agent = % { ice_agent | eoc: true }
487
487
# check whether it's time to nominate and if yes, try noimnate
488
- maybe_nominate ( ice_agent )
488
+ ice_agent
489
+ |> maybe_nominate ( )
490
+ |> update_connection_state ( )
489
491
end
490
492
491
493
@ spec send_data ( t ( ) , binary ( ) ) :: t ( )
@@ -580,6 +582,7 @@ defmodule ExICE.Priv.ICEAgent do
580
582
|> update_gathering_state ( )
581
583
|> update_connection_state ( )
582
584
|> maybe_nominate ( )
585
+ |> update_connection_state ( )
583
586
584
587
if ice_agent . state in [ :completed , :failed ] do
585
588
update_ta_timer ( ice_agent )
@@ -591,7 +594,9 @@ defmodule ExICE.Priv.ICEAgent do
591
594
ice_agent
592
595
593
596
{ type , tr } ->
594
- execute_transaction ( ice_agent , type , tr )
597
+ ice_agent
598
+ |> execute_transaction ( type , tr )
599
+ |> update_connection_state ( )
595
600
end
596
601
597
602
# schedule next check and call update_ta_timer
Original file line number Diff line number Diff line change @@ -1592,8 +1592,6 @@ defmodule ExICE.Priv.ICEAgentTest do
1592
1592
# try to send conn check
1593
1593
ice_agent = ICEAgent . handle_ta_timeout ( ice_agent )
1594
1594
1595
- assert ice_agent . state == :checking
1596
-
1597
1595
# assert that the candidate pair has moved to a failed state
1598
1596
# and that the state was updated after the packet was discarded
1599
1597
assert [
@@ -1605,8 +1603,6 @@ defmodule ExICE.Priv.ICEAgentTest do
1605
1603
}
1606
1604
] = Map . values ( ice_agent . checklist )
1607
1605
1608
- ice_agent = ICEAgent . handle_ta_timeout ( ice_agent )
1609
-
1610
1606
assert ice_agent . state == :failed
1611
1607
end
1612
1608
@@ -1650,10 +1646,6 @@ defmodule ExICE.Priv.ICEAgentTest do
1650
1646
}
1651
1647
] = Map . values ( ice_agent . checklist )
1652
1648
1653
- assert ice_agent . state == :connected
1654
-
1655
- ice_agent = ICEAgent . handle_ta_timeout ( ice_agent )
1656
-
1657
1649
assert ice_agent . state == :failed
1658
1650
end
1659
1651
end
You can’t perform that action at this time.
0 commit comments