style
This commit is contained in:
parent
b9d5fa94f9
commit
d3941e70c6
|
@ -123,23 +123,15 @@ let handle s addr () =
|
||||||
(if not (version_eq hdr.version my_version) then
|
(if not (version_eq hdr.version my_version) then
|
||||||
Lwt.return (Error (`Msg "ignoring data with bad version"))
|
Lwt.return (Error (`Msg "ignoring data with bad version"))
|
||||||
else
|
else
|
||||||
|
match decode_str data with
|
||||||
|
| Error e -> Lwt.return (Error e)
|
||||||
|
| Ok (name, off) ->
|
||||||
match Console.int_to_op hdr.tag with
|
match Console.int_to_op hdr.tag with
|
||||||
| Some Add ->
|
| Some Add -> add_fifo s name
|
||||||
(match decode_str data with
|
| Some Attach -> attach name
|
||||||
| Error e -> Lwt.return (Error e)
|
| Some Detach -> detach name
|
||||||
| Ok (name, _) -> add_fifo s name)
|
|
||||||
| Some Attach ->
|
|
||||||
(match decode_str data with
|
|
||||||
| Error e -> Lwt.return (Error e)
|
|
||||||
| Ok (name, _) -> attach name)
|
|
||||||
| Some Detach ->
|
|
||||||
(match decode_str data with
|
|
||||||
| Error e -> Lwt.return (Error e)
|
|
||||||
| Ok (name, _) -> detach name)
|
|
||||||
| Some History ->
|
| Some History ->
|
||||||
(match decode_str data with
|
(match decode_ts ~off data with
|
||||||
| Error e -> Lwt.return (Error e)
|
|
||||||
| Ok (name, off) -> match decode_ts ~off data with
|
|
||||||
| Error e -> Lwt.return (Error e)
|
| Error e -> Lwt.return (Error e)
|
||||||
| Ok since -> history s name since)
|
| Ok since -> history s name since)
|
||||||
| _ ->
|
| _ ->
|
||||||
|
|
|
@ -85,8 +85,7 @@ let handle fd ring s addr () =
|
||||||
in
|
in
|
||||||
Ok (`Out out)
|
Ok (`Out out)
|
||||||
end
|
end
|
||||||
| _ ->
|
| _ -> Error (`Msg "unknown command"))
|
||||||
Error (`Msg "unknown command"))
|
|
||||||
in
|
in
|
||||||
match out with
|
match out with
|
||||||
| Error (`Msg msg) ->
|
| Error (`Msg msg) ->
|
||||||
|
|
|
@ -13,7 +13,7 @@ let subca_csr key name cpus mem vms block bridges =
|
||||||
| Some x -> [ (false, `Unsupported (Oid.block, int_to_cstruct x)) ]
|
| Some x -> [ (false, `Unsupported (Oid.block, int_to_cstruct x)) ]
|
||||||
and bridge = match bridges with
|
and bridge = match bridges with
|
||||||
| [] -> []
|
| [] -> []
|
||||||
| xs -> [ (false, `Unsupported (Oid.bridges, bridges_to_cstruct bridges)) ]
|
| xs -> [ (false, `Unsupported (Oid.bridges, bridges_to_cstruct xs)) ]
|
||||||
in
|
in
|
||||||
let exts =
|
let exts =
|
||||||
[ (false, `Unsupported (Oid.version, version_to_cstruct asn_version)) ;
|
[ (false, `Unsupported (Oid.version, version_to_cstruct asn_version)) ;
|
||||||
|
|
|
@ -345,7 +345,7 @@ let handle_revocation t s leaf chain ca prefix =
|
||||||
| None -> Ok ()
|
| None -> Ok ()
|
||||||
| Some local -> match X509.CRL.crl_number local, X509.CRL.crl_number crl with
|
| Some local -> match X509.CRL.crl_number local, X509.CRL.crl_number crl with
|
||||||
| None, _ -> Ok ()
|
| None, _ -> Ok ()
|
||||||
| Some x, None -> Error (`Msg "CRL number not present")
|
| Some _, None -> Error (`Msg "CRL number not present")
|
||||||
| Some x, Some y -> if y > x then Ok () else Error (`Msg "CRL number not increased")) >>= fun () ->
|
| Some x, Some y -> if y > x then Ok () else Error (`Msg "CRL number not increased")) >>= fun () ->
|
||||||
(* filename should be whatever_dir / crls / <id> *)
|
(* filename should be whatever_dir / crls / <id> *)
|
||||||
let filename = Fpath.(t.dir / "crls" / string_of_id prefix) in
|
let filename = Fpath.(t.dir / "crls" / string_of_id prefix) in
|
||||||
|
@ -355,7 +355,7 @@ let handle_revocation t s leaf chain ca prefix =
|
||||||
let crls =
|
let crls =
|
||||||
match local with
|
match local with
|
||||||
| None -> crl :: t.crls
|
| None -> crl :: t.crls
|
||||||
| Some x -> crl :: List.filter (fun c -> c <> crl) t.crls
|
| Some _ -> crl :: List.filter (fun c -> c <> crl) t.crls
|
||||||
in
|
in
|
||||||
(* iterate over revoked serials, find active resources, and kill them *)
|
(* iterate over revoked serials, find active resources, and kill them *)
|
||||||
let newly_revoked =
|
let newly_revoked =
|
||||||
|
@ -508,7 +508,7 @@ let handle_log state hdr buf =
|
||||||
state, []
|
state, []
|
||||||
end else match IM.find hdr.id state.log_requests with
|
end else match IM.find hdr.id state.log_requests with
|
||||||
| exception Not_found ->
|
| exception Not_found ->
|
||||||
Logs.err (fun m -> m "coudn't find log request") ;
|
Logs.warn (fun m -> m "(ignored) coudn't find log request") ;
|
||||||
(state, [])
|
(state, [])
|
||||||
| (s, rid) ->
|
| (s, rid) ->
|
||||||
let r = match int_to_op hdr.tag with
|
let r = match int_to_op hdr.tag with
|
||||||
|
|
Loading…
Reference in a new issue