stalwartlabs / mail-send

E-mail delivery library for Rust with DKIM support
https://docs.rs/mail-send/
Apache License 2.0
206 stars 21 forks source link

fix: Extend buffer from bytes read while reading EHLO #13

Closed LeoniePhiline closed 1 year ago

LeoniePhiline commented 1 year ago

Fixes #12

(You only need to read the very bottom of https://github.com/stalwartlabs/mail-send/issues/12#issuecomment-1432226194 - the rest above that is explorative debugging.)

The above linked comment explains what is fixed here:

When a single chunk is not enough, then the here-corrected method previously dumped the entire zeroed buffer into a vector. It then appended to the end of the full 1024 bytes on the next loop iteration.

This PR fixes this behavior by only dumping the bytes read into the concatenation vec.

mdecimus commented 1 year ago

Nice catch, thanks! Merged.