P2p: missing Lwt_utils.protect
in the reader worker.
This commit is contained in:
parent
c9fe53eb10
commit
cb1e5cc396
@ -261,16 +261,19 @@ module Reader = struct
|
||||
|
||||
|
||||
let rec worker_loop st init_mbytes =
|
||||
Lwt_unix.yield () >>= fun () ->
|
||||
begin
|
||||
read_message st init_mbytes >>=? fun msg ->
|
||||
match msg with
|
||||
| None ->
|
||||
Lwt_utils.protect ~canceler:st.canceler begin fun () ->
|
||||
Lwt_pipe.push st.messages (Error [Decoding_error]) >>= fun () ->
|
||||
return None
|
||||
end
|
||||
| Some (msg, size, rem_mbytes) ->
|
||||
Lwt_utils.protect ~canceler:st.canceler begin fun () ->
|
||||
Lwt_pipe.push st.messages (Ok (size, msg)) >>= fun () ->
|
||||
return (Some rem_mbytes)
|
||||
end
|
||||
end >>= function
|
||||
| Ok Some rem_mbytes ->
|
||||
worker_loop st rem_mbytes
|
||||
|
Loading…
Reference in New Issue
Block a user