Skip to content

Commit

Permalink
fix(test): wrong message size
Browse files Browse the repository at this point in the history
  • Loading branch information
aoudiamoncef committed Feb 16, 2023
1 parent d667950 commit e4ccacb
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
1 change: 0 additions & 1 deletion tonic/src/codec/encode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,6 @@ fn finish_encoding(
buf: &mut BytesMut,
) -> Result<Bytes, Status> {
let len = buf.len() - HEADER_SIZE;

let limit = max_message_size.unwrap_or(DEFAULT_MAX_MESSAGE_SIZE);
if len > limit {
return Err(Status::new(
Expand Down
2 changes: 1 addition & 1 deletion tonic/src/codec/prost.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ mod tests {

buf.put(&msg[..]);

let body = body::MockBody::new(&buf[..], 10005, 0);
let body = body::MockBody::new(&buf[..], MAX_MESSAGE_SIZE + HEADER_SIZE + 1, 0);

let mut stream = Streaming::new_request(decoder, body, None, Some(MAX_MESSAGE_SIZE));

Expand Down

0 comments on commit e4ccacb

Please sign in to comment.