P2P: Do not log ``ordinary'' errors

This commit is contained in:
Vincent Bernardoff 2016-11-30 15:04:06 +01:00 committed by Grégoire Henry
parent e1d6df6e99
commit a832c2069f

View File

@ -424,11 +424,13 @@ module Make (P: PARAMS) = struct
port = config.incoming_port ; port = config.incoming_port ;
versions = P.supported_versions }) >>= fun _ -> versions = P.supported_versions }) >>= fun _ ->
Lwt.pick Lwt.pick
[ ( LU.sleep limits.peer_answer_timeout >>= fun () -> [ ( LU.sleep limits.peer_answer_timeout >>= fun () -> Error_monad.fail Timeout ) ;
Error_monad.fail Timeout ) ;
recv buf ] >>= function recv buf ] >>= function
| Error [Timeout] | Error [Canceled] | Error [Exn End_of_file] ->
(* Expected errors. No logging. *)
cancel ()
| Error err -> | Error err ->
debug "(%a) error receiving from %a:%d: %a" log_error "(%a) error receiving from %a:%d: %a"
pp_gid my_gid Ipaddr.pp_hum addr port Error_monad.pp_print_error err ; pp_gid my_gid Ipaddr.pp_hum addr port Error_monad.pp_print_error err ;
cancel () cancel ()
| Ok (Connect { gid; port = listening_port; versions ; | Ok (Connect { gid; port = listening_port; versions ;