Skip to content

Commit 855f57e

Browse files
authored
fix(Transport): close oneshot transport on error (#340)
1 parent 98bf02d commit 855f57e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

crates/rmcp/src/transport.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,8 @@ where
221221
item: TxJsonRpcMessage<R>,
222222
) -> impl Future<Output = Result<(), Self::Error>> + Send + 'static {
223223
let sender = self.sender.clone();
224-
let terminate = matches!(item, TxJsonRpcMessage::<R>::Response(_));
224+
let terminate = matches!(item, TxJsonRpcMessage::<R>::Response(_))
225+
|| matches!(item, TxJsonRpcMessage::<R>::Error(_));
225226
let signal = self.finished_signal.clone();
226227
async move {
227228
sender.send(item).await?;

0 commit comments

Comments
 (0)