chiark / gitweb /
mgmtchannel: Add threadsafety bounds to the bulk writer
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Mon, 17 May 2021 13:08:05 +0000 (14:08 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Mon, 17 May 2021 14:00:19 +0000 (15:00 +0100)
Acked-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
src/mgmtchannel.rs

index 962e78db4e233bed83acdb2d98dd61b6dde7ecda..a40d961cafb30dd8be974deeb4e5ef9284aad502 100644 (file)
@@ -58,7 +58,7 @@ impl MgmtChannel {
 
   #[throws(AE)]
   pub fn new<U>(conn: U) -> MgmtChannel
-  where U: IoTryClone + Read + Write + IntoRawFd + 'static,
+  where U: IoTryClone + Read + Write + IntoRawFd + Send + 'static,
   {
     let read = conn.try_clone().context("dup the command stream")?;
     let read = TimedFdReader::new(read).context("set up timed reader")?;
@@ -73,7 +73,7 @@ impl MgmtChannel {
                            up: &mut U, down: &mut D,
                            progress: &mut dyn termprogress::Reporter)
                            -> MgmtResponse
-  where U: Read, D: Write,
+  where U: Read + Send, D: Write,
   {
     use MgmtResponse::*;
     let mut wbulk = self.write