File tree Expand file tree Collapse file tree 1 file changed +3
-7
lines changed Expand file tree Collapse file tree 1 file changed +3
-7
lines changed Original file line number Diff line number Diff line change @@ -109,10 +109,6 @@ impl<R: Read + Write + Unpin> ImapStream<R> {
109
109
start : usize ,
110
110
end : usize ,
111
111
) -> io:: Result < DecodeResult > {
112
- if self . decode_needs > end - start {
113
- return Ok ( DecodeResult :: None ( buf) ) ;
114
- }
115
-
116
112
log:: trace!( "< {:?}" , std:: str :: from_utf8( & buf[ start..end] ) ) ;
117
113
118
114
let mut rest = None ;
@@ -186,9 +182,9 @@ impl<R: Read + Write + Unpin> Stream for ImapStream<R> {
186
182
} ;
187
183
188
184
loop {
189
- if ( n. 1 - n. 0 ) >= buffer. capacity ( ) {
190
- if buffer. capacity ( ) + 1024 < MAX_CAPACITY {
191
- buffer. realloc ( buffer. capacity ( ) + 1024 ) ;
185
+ if ( n. 1 - n. 0 ) + this . decode_needs >= buffer. capacity ( ) {
186
+ if buffer. capacity ( ) + this . decode_needs < MAX_CAPACITY {
187
+ buffer. realloc ( buffer. capacity ( ) + this . decode_needs ) ;
192
188
} else {
193
189
return Poll :: Ready ( Some ( Err ( io:: Error :: new (
194
190
io:: ErrorKind :: Other ,
You can’t perform that action at this time.
0 commit comments