mirror of
https://github.com/fluencelabs/rust-libp2p
synced 2025-06-30 18:21:33 +00:00
[request-response] Close substream after writing request/response. (#1660)
* Close substream after writing request/response. * Update protocols/request-response/src/handler/protocol.rs Co-authored-by: Thomas Eizinger <thomas@eizinger.io> Co-authored-by: Thomas Eizinger <thomas@eizinger.io>
This commit is contained in:
@ -113,6 +113,7 @@ where
|
||||
write.await?;
|
||||
}
|
||||
}
|
||||
io.close().await?;
|
||||
Ok(())
|
||||
}.boxed()
|
||||
}
|
||||
@ -156,10 +157,10 @@ where
|
||||
async move {
|
||||
let write = self.codec.write_request(&protocol, &mut io, self.request);
|
||||
write.await?;
|
||||
io.close().await?;
|
||||
let read = self.codec.read_response(&protocol, &mut io);
|
||||
let response = read.await?;
|
||||
Ok(response)
|
||||
}.boxed()
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user