We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9df3867 commit 9728c01Copy full SHA for 9728c01
tonic/src/codec/encode.rs
@@ -330,6 +330,16 @@ where
330
self.state.is_end_stream
331
}
332
333
+ fn size_hint(&self) -> http_body::SizeHint {
334
+ let sh = self.inner.size_hint();
335
+ let mut size_hint = http_body::SizeHint::new();
336
+ size_hint.set_lower(sh.0 as u64);
337
+ if let Some(upper) = sh.1 {
338
+ size_hint.set_upper(upper as u64);
339
+ }
340
+ size_hint
341
342
+
343
fn poll_data(
344
self: Pin<&mut Self>,
345
cx: &mut Context<'_>,
tonic/src/transport/server/recover_error.rs
@@ -124,4 +124,11 @@ where
124
None => true,
125
126
127
128
129
+ match &self.inner {
130
+ Some(body) => body.size_hint(),
131
+ None => http_body::SizeHint::with_exact(0),
132
133
134
0 commit comments