[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:
Roman Borschel
2020-07-13 12:35:32 +02:00
committed by GitHub
parent e61ccd22df
commit c8b426005f
3 changed files with 11 additions and 2 deletions

View File

@ -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()
}
}