vmm_lwt/vmm_tls: less debug output of read/write stuff

This commit is contained in:
Hannes Mehnert 2018-03-22 14:12:50 +01:00
parent ceab24948d
commit e48d3b3457
2 changed files with 6 additions and 6 deletions

View file

@ -67,9 +67,9 @@ let read_exactly s =
r b 0 l >|= function
| Error e -> Error e
| Ok () ->
Logs.debug (fun m -> m "read hdr %a, body %a"
(* Logs.debug (fun m -> m "read hdr %a, body %a"
Cstruct.hexdump_pp (Cstruct.of_bytes buf)
Cstruct.hexdump_pp (Cstruct.of_bytes b)) ;
Cstruct.hexdump_pp (Cstruct.of_bytes b)) ; *)
Ok (hdr, Bytes.to_string b)
else
Lwt.return (Ok (hdr, ""))
@ -87,5 +87,5 @@ let write_raw s buf =
Logs.err (fun m -> m "exception %s while writing" (Printexc.to_string e)) ;
Lwt.return (Error `Exception))
in
Logs.debug (fun m -> m "writing %a" Cstruct.hexdump_pp (Cstruct.of_bytes buf)) ;
(* Logs.debug (fun m -> m "writing %a" Cstruct.hexdump_pp (Cstruct.of_bytes buf)) ; *)
w 0 (Bytes.length buf)

View file

@ -39,15 +39,15 @@ let read_tls t =
r_n b 0 l >|= function
| Error e -> Error e
| Ok () ->
Logs.debug (fun m -> m "TLS read id %d %a tag %d data %a"
(* Logs.debug (fun m -> m "TLS read id %d %a tag %d data %a"
hdr.Vmm_wire.id Vmm_wire.pp_version hdr.Vmm_wire.version hdr.Vmm_wire.tag
Cstruct.hexdump_pp b) ;
Cstruct.hexdump_pp b) ; *)
Ok (hdr, Cstruct.to_string b)
else
Lwt.return (Ok (hdr, ""))
let write_tls s buf =
Logs.debug (fun m -> m "TLS write %a" Cstruct.hexdump_pp (Cstruct.of_string buf)) ;
(* Logs.debug (fun m -> m "TLS write %a" Cstruct.hexdump_pp (Cstruct.of_string buf)) ; *)
Lwt.catch
(fun () -> Tls_lwt.Unix.write s (Cstruct.of_string buf) >|= fun () -> Ok ())
(function