Update xml5ever.

This commit is contained in:
Emmanuel Gil Peyrot 2019-06-12 16:44:13 +02:00
parent 956193e0da
commit c6ab5a22b8
2 changed files with 5 additions and 2 deletions

View file

@ -17,7 +17,7 @@ tokio = "0.1"
tokio-io = "0.1"
tokio-codec = "0.1"
bytes = "0.4"
xml5ever = "0.12"
xml5ever = "0.14"
native-tls = "0.2"
tokio-tls = "0.2"
sasl = "0.4"

View file

@ -18,6 +18,7 @@ use std::borrow::Cow;
use tokio_codec::{Decoder, Encoder};
use xml5ever::interface::Attribute;
use xml5ever::tokenizer::{Tag, TagKind, Token, TokenSink, XmlTokenizer};
use xml5ever::buffer_queue::BufferQueue;
/// Anything that can be sent or received on an XMPP/XML stream
#[derive(Debug, Clone, PartialEq, Eq)]
@ -231,8 +232,10 @@ impl Decoder for XMPPCodec {
Ok(s) => {
if !s.is_empty() {
// println!("<< {}", s);
let mut buffer_queue = BufferQueue::new();
let tendril = FromIterator::from_iter(s.chars());
self.parser.feed(tendril);
buffer_queue.push_back(tendril);
self.parser.feed(&mut buffer_queue);
}
}
// Remedies for truncated utf8