File tree 1 file changed +6
-7
lines changed
1 file changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -119,6 +119,10 @@ module Make(Time:Mirage_time.S) = struct
119
119
t.on_close () ;
120
120
Lwt. return_unit
121
121
122
+ let transition_to_timewait t =
123
+ Lwt. async (fun () -> timewait t time_wait_time);
124
+ Time_wait
125
+
122
126
let tick t (i :action ) =
123
127
let diffone x y = Sequence. succ y = x in
124
128
let tstr s (i :action ) =
@@ -148,15 +152,10 @@ module Make(Time:Mirage_time.S) = struct
148
152
| Fin_wait_1 _ , Recv_rst -> t.on_close () ; Reset
149
153
| Fin_wait_2 i , Recv_ack _ -> Fin_wait_2 (i + 1 )
150
154
| Fin_wait_2 _ , Recv_rst -> t.on_close () ; Reset
151
- | Fin_wait_2 _ , Recv_fin ->
152
- Lwt. async (fun () -> timewait t time_wait_time);
153
- Time_wait
155
+ | Fin_wait_2 _ , Recv_fin -> transition_to_timewait t
154
156
| Closing a , Recv_ack b ->
155
157
if diffone b a then
156
- begin
157
- Lwt. async (fun () -> timewait t time_wait_time);
158
- Time_wait
159
- end
158
+ transition_to_timewait t
160
159
else Closing a
161
160
| Closing _ , Timeout -> t.on_close () ; Closed
162
161
| Closing _ , Recv_rst -> t.on_close () ; Reset
You can’t perform that action at this time.
0 commit comments