Add comment on cancellation
continuous-integration/drone/push Build was killed Details
continuous-integration/drone/pr Build was killed Details

This commit is contained in:
Alex 2022-09-13 12:05:42 +02:00
parent add2b54743
commit db96af2609
Signed by: lx
GPG Key ID: 0E496D15096376BE
1 changed files with 5 additions and 0 deletions

View File

@ -499,6 +499,11 @@ impl RespEnc {
let msg_len = reader.read_u32().await?;
let msg = reader.read_exact(msg_len as usize).await?;
// Check whether the response stream still has data or not.
// If no more data is coming, this will defuse the request canceller.
// If we didn't do this, and the client doesn't try to read from the stream,
// the request canceller doesn't know that we read everything and
// sends a cancellation message to the server (which they don't care about).
reader.fill_buffer().await;
Ok(Self {