Merge pull request #1 from LeoniePhiline/fix/typo-max-response-length

fix: Typo in `MAX_RESPONSE_LENGTH`
This commit is contained in:
Mauro D 2023-02-16 19:05:49 +01:00 committed by GitHub
commit d3f7933404
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -27,7 +27,7 @@ use crate::{request::parser::Rfc5321Parser, *};
use super::*; use super::*;
pub const MAX_REPONSE_LENGTH: usize = 4096; pub const MAX_RESPONSE_LENGTH: usize = 4096;
#[derive(Default)] #[derive(Default)]
pub struct ResponseReceiver { pub struct ResponseReceiver {
@ -145,7 +145,7 @@ impl ResponseReceiver {
_ => match ch { _ => match ch {
b'\r' | b'\n' => (), b'\r' | b'\n' => (),
_ => { _ => {
if self.buf.len() < MAX_REPONSE_LENGTH { if self.buf.len() < MAX_RESPONSE_LENGTH {
self.buf.push(ch); self.buf.push(ch);
} else { } else {
return Err(Error::ResponseTooLong); return Err(Error::ResponseTooLong);
@ -351,7 +351,7 @@ impl EhloResponse<String> {
parser.seek_lf()?; parser.seek_lf()?;
break; break;
} }
ch if buf.len() < MAX_REPONSE_LENGTH => { ch if buf.len() < MAX_RESPONSE_LENGTH => {
buf.push(ch); buf.push(ch);
} }
_ => return Err(Error::ResponseTooLong), _ => return Err(Error::ResponseTooLong),