diff options
author | Justus Winter <justus@sequoia-pgp.org> | 2022-06-09 12:05:42 +0200 |
---|---|---|
committer | Justus Winter <justus@sequoia-pgp.org> | 2024-01-22 13:05:38 +0100 |
commit | 96d829d681ea1b860bf4b16439082929f4636147 (patch) | |
tree | df23193f76319a0be62e0d2630d11157ce1a0da1 /openpgp/src/cert | |
parent | f396703a0ca809ce6200d7cb009a9bc83dd6683a (diff) |
openpgp: Rename every from_buffered_reader to from_cookie_reader.
- This is an internal interface that uses our reader stack's
cookie. We need this to traverse the buffered reader stack. We
did not, however, expose it as an external interface, because we
didn't want to bake in the cookie type into the API.
- Having a public API that operates on buffered readers is
convenient: the current Parser::from_reader operates on
io::Readers, and will most likely construct a
buffered_reader::Generic from it. This will eagerly buffer some
data, making this interface unsuitable if you want to read in one
artifact (e.g. an MPI) without consuming more data.
- Renaming the internal functions gives us a chance to add a more
general buffered reader interface.
Diffstat (limited to 'openpgp/src/cert')
-rw-r--r-- | openpgp/src/cert/parser/mod.rs | 2 | ||||
-rw-r--r-- | openpgp/src/cert/raw.rs | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/openpgp/src/cert/parser/mod.rs b/openpgp/src/cert/parser/mod.rs index eea20d49..147f32de 100644 --- a/openpgp/src/cert/parser/mod.rs +++ b/openpgp/src/cert/parser/mod.rs @@ -521,7 +521,7 @@ impl<'a> From<PacketParserResult<'a>> for CertParser<'a> tracer!(TRACE, "PacketParserResult::next", 0); if let Some(reader) = retry_with_reader.take() { // Try to find the next (armored) blob. - match PacketParser::from_buffered_reader(reader) { + match PacketParser::from_cookie_reader(reader) { Ok(PacketParserResult::Some(pp)) => { // We read at least one packet. Try // to parse the next cert. diff --git a/openpgp/src/cert/raw.rs b/openpgp/src/cert/raw.rs index f999e66d..e9610818 100644 --- a/openpgp/src/cert/raw.rs +++ b/openpgp/src/cert/raw.rs @@ -617,7 +617,7 @@ impl<'a> RawCertParser<'a> { let mut reader = dup.into_boxed().into_inner().expect("inner"); if dearmor { - reader = armor::Reader::from_buffered_reader( + reader = armor::Reader::from_cookie_reader( reader, armor::ReaderMode::Tolerant(None), Default::default()).into_boxed(); @@ -709,7 +709,7 @@ impl<'a> Iterator for RawCertParser<'a> let reader = reader.into_inner().expect("the armor reader"); // and install a new one! - self.reader = armor::Reader::from_buffered_reader( + self.reader = armor::Reader::from_cookie_reader( reader, armor::ReaderMode::Tolerant(None), Default::default()).into_boxed(); } |