diff options
author | Vincent Richard <[email protected]> | 2013-06-24 13:32:40 +0000 |
---|---|---|
committer | Vincent Richard <[email protected]> | 2013-06-24 13:32:40 +0000 |
commit | 895b07cae9741f44a1272b2f3875f8dd94763222 (patch) | |
tree | 6532de59e01676c78b423b5de5ebc1411c7da111 /src/utility/encoder/uuEncoder.cpp | |
parent | Return after sending message when sending is supported. (diff) | |
download | vmime-895b07cae9741f44a1272b2f3875f8dd94763222.tar.gz vmime-895b07cae9741f44a1272b2f3875f8dd94763222.zip |
Added support for SIZE SMTP extension (RFC-1870).
Diffstat (limited to '')
-rw-r--r-- | src/utility/encoder/uuEncoder.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/utility/encoder/uuEncoder.cpp b/src/utility/encoder/uuEncoder.cpp index 00d90cee..3f751d3b 100644 --- a/src/utility/encoder/uuEncoder.cpp +++ b/src/utility/encoder/uuEncoder.cpp @@ -326,6 +326,22 @@ utility::stream::size_type uuEncoder::decode(utility::inputStream& in, } +utility::stream::size_type uuEncoder::getEncodedSize(const utility::stream::size_type n) const +{ + // 3 bytes of input provide 4 bytes of output. + // Count CRLF (2 bytes) for each line of 45 characters. + // Also reserve some space for header and footer. + return 200 + n * 3 + (n / 45) * 2; +} + + +utility::stream::size_type uuEncoder::getDecodedSize(const utility::stream::size_type n) const +{ + // 4 bytes of input provide 3 bytes of output + return (n * 3) / 4; +} + + } // encoder } // utility } // vmime |