diff options
Diffstat (limited to 'openpgp/src/armor.rs')
-rw-r--r-- | openpgp/src/armor.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/openpgp/src/armor.rs b/openpgp/src/armor.rs index fb6ac87b..ed19c63a 100644 --- a/openpgp/src/armor.rs +++ b/openpgp/src/armor.rs @@ -1534,12 +1534,6 @@ impl<'a> Reader<'a> { self.cursor, self.buffer.as_ref().map(|buffer| buffer.len())); - // See if there is an error from the last invocation. - if let Some(e) = self.error.take() { - t!("Returning stashed error: {}", e); - return Err(e); - } - if let Some(ref buffer) = self.buffer { // We have a buffer. Make sure `cursor` is sane. assert!(self.cursor <= buffer.len()); @@ -1575,6 +1569,12 @@ impl<'a> Reader<'a> { break; } + // See if there is an error from the last invocation. + if let Some(e) = &self.error { + t!("We have a stashed error, don't poll again: {}", e); + break; + } + match self.do_read(&mut buffer_new [amount_buffered + amount_read..]) { Ok(read) => { |