aboutsummaryrefslogtreecommitdiff
path: root/src/message.rs
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2022-09-13 12:05:42 +0200
committerAlex Auvolat <alex@adnab.me>2022-09-13 12:05:42 +0200
commitdb96af2609a75284c5608cf592c3d4ce4b28ae0b (patch)
tree7c0e95b7f3a15f93c6d4da267bb47b76eac3fb74 /src/message.rs
parentadd2b54743a76bf805b0dc5ab7a1d8d326445314 (diff)
downloadnetapp-db96af2609a75284c5608cf592c3d4ce4b28ae0b.tar.gz
netapp-db96af2609a75284c5608cf592c3d4ce4b28ae0b.zip
Add comment on cancellation
Diffstat (limited to 'src/message.rs')
-rw-r--r--src/message.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/message.rs b/src/message.rs
index cc816c6..b12da32 100644
--- a/src/message.rs
+++ b/src/message.rs
@@ -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 {