File tree Expand file tree Collapse file tree 4 files changed +17
-14
lines changed Expand file tree Collapse file tree 4 files changed +17
-14
lines changed Original file line number Diff line number Diff line change @@ -156,12 +156,6 @@ module Chunk : sig
156
156
val client_version : t -> Client_id .t -> int
157
157
val client_next_xid : t -> Client_id .t -> int32
158
158
159
- val send_txn
160
- : t
161
- -> Client_id. t
162
- -> m
163
- -> [ `Sent of Message. t Deferred. t | `Drop of exn ] Deferred. t
164
-
165
159
val handshake : int -> (t , e , h ) Stage .t
166
160
end
167
161
Original file line number Diff line number Diff line change @@ -222,7 +222,7 @@ module Controller = struct
222
222
223
223
let barrier t sw_id =
224
224
send_txn_with t sw_id M. BarrierRequest (function
225
- | M. BarrierReply -> Result. Ok ()
225
+ | `Result ( hdr , _ ) -> Result. Ok () (* assume it is a barrier reply * )
226
226
| _ -> assert false )
227
227
228
228
let aggregate_stats ?(pattern =C. match_all) (t :t ) sw_id =
@@ -233,7 +233,10 @@ module Controller = struct
233
233
; sr_out_port = None }
234
234
in
235
235
send_txn_with t sw_id (M. StatsRequestMsg msg) (function
236
- | M. StatsReplyMsg (AggregateFlowRep r ) -> Result. Ok r
236
+ | `Result (hdr , body ) ->
237
+ (match M. parse hdr (Cstruct. to_string body) with
238
+ | (_ , M. StatsReplyMsg (AggregateFlowRep r )) -> Result. Ok r
239
+ | _ -> assert false )
237
240
| _ -> assert false )
238
241
239
242
let individual_stats ?(pattern =C. match_all) (t :t ) sw_id =
@@ -244,6 +247,9 @@ module Controller = struct
244
247
; sr_out_port = None }
245
248
in
246
249
send_txn_with t sw_id (M. StatsRequestMsg msg) (function
247
- | M. StatsReplyMsg (IndividualFlowRep r ) -> Result. Ok r
248
- | _ -> assert false )
250
+ | `Result (hdr , body ) ->
251
+ (match M. parse hdr (Cstruct. to_string body) with
252
+ | (_ , M. StatsReplyMsg (IndividualFlowRep r )) -> Result. Ok r
253
+ | _ -> assert false )
254
+ | _ -> assert false )
249
255
end
Original file line number Diff line number Diff line change @@ -255,7 +255,10 @@ module Controller = struct
255
255
256
256
let barrier t sw_id =
257
257
send_txn_with t sw_id M. BarrierRequest (function
258
- | M. BarrierReply -> Result. Ok ()
258
+ | `Result (hdr , body ) ->
259
+ (match M. parse hdr (Cstruct. to_string body) with
260
+ | (_ , M. BarrierReply) -> Result. Ok ()
261
+ | _ -> assert false )
259
262
| _ -> assert false )
260
263
261
264
end
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ open Core.Std
3
3
module Platform = Async_OpenFlow_Platform
4
4
module Header = OpenFlow_Header
5
5
6
- module Message : Platform .Message
6
+ module Message : Platform .Message
7
7
with type t = (Header. t * Cstruct. t) = struct
8
8
9
9
type t = (Header .t * Cstruct .t ) sexp_opaque with sexp
@@ -73,7 +73,7 @@ module Controller = struct
73
73
let ivar = ref None in
74
74
if not (xid = 0l ) then
75
75
XidTbl. change t.txns xid (function
76
- | None -> let ivar = ref ( Some ( Ivar. create () )) in ! ivar
76
+ | None -> ivar := Some ( Ivar. create () ); ! ivar
77
77
| Some (_ ) -> None );
78
78
match ! ivar with
79
79
| Some (ivar ) -> ivar
@@ -252,7 +252,7 @@ module Controller = struct
252
252
| `Sent x -> Handler. activity t c_id; `Sent x
253
253
| `Drop x -> `Drop x
254
254
255
- let send_txn t c_id m =
255
+ let send_txn t c_id ( m : Message.t ) =
256
256
let conn = Client_id.Table. find_exn t.clients c_id in
257
257
let ivar = Conn. add_txn conn m in
258
258
send t c_id m
You can’t perform that action at this time.
0 commit comments