@@ -55,7 +55,7 @@ let rec reset_seq segs =
55
55
It also looks for control messages and dispatches them to
56
56
the Rtx queue to ack messages or close channels.
57
57
*)
58
- module Rx (Time :Mirage_time.S ) = struct
58
+ module Rx (Time :Mirage_time.S )( ACK : Ack.M ) = struct
59
59
open Tcp_packet
60
60
module StateTick = State. Make (Time )
61
61
@@ -84,15 +84,15 @@ module Rx(Time:Mirage_time.S) = struct
84
84
type t = {
85
85
mutable segs : S .t ;
86
86
rx_data : (Cstruct .t list option * Sequence .t option ) Lwt_mvar .t ; (* User receive channel *)
87
- send_ack : Sequence .t Lwt_mvar .t ;
87
+ ack : ACK .t ;
88
88
tx_ack : (Sequence .t * int ) Lwt_mvar .t ; (* Acks of our transmitted segs *)
89
89
wnd : Window .t ;
90
90
state : State .t ;
91
91
}
92
92
93
- let create ~rx_data ~send_ack ~wnd ~state ~tx_ack =
93
+ let create ~rx_data ~ack ~wnd ~state ~tx_ack =
94
94
let segs = S. empty in
95
- { segs; rx_data; send_ack ; tx_ack; wnd; state }
95
+ { segs; rx_data; ack ; tx_ack; wnd; state }
96
96
97
97
let pp fmt t =
98
98
let pp_v fmt seg =
@@ -136,9 +136,7 @@ module Rx(Time:Mirage_time.S) = struct
136
136
137
137
let send_challenge_ack q =
138
138
(* TODO: rfc5961 ACK Throttling *)
139
- if Lwt_mvar. is_empty q.send_ack
140
- then Lwt_mvar. put q.send_ack Sequence. zero
141
- else Lwt. return_unit
139
+ ACK. pushack q.ack Sequence. zero
142
140
143
141
(* Given an input segment, the window information, and a receive
144
142
queue, update the window, extract any ready segments into the
0 commit comments