Merge pull request #1156 from yubiuser/update/quick_xml

Update quick-xml
This commit is contained in:
Roderick van Domburg 2023-04-14 22:21:22 +02:00 committed by GitHub
commit e4d4765332
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 11 deletions

8
Cargo.lock generated
View file

@ -974,9 +974,9 @@ checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4"
[[package]] [[package]]
name = "hyper" name = "hyper"
version = "0.14.25" version = "0.14.26"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cc5e554ff619822309ffd57d8734d77cd5ce6238bc956f037ea06c58238c9899" checksum = "ab302d72a6f11a3b910431ff93aae7e773078c769f0a3ef15fb9ec692ed147d4"
dependencies = [ dependencies = [
"bytes", "bytes",
"futures-channel", "futures-channel",
@ -2119,9 +2119,9 @@ dependencies = [
[[package]] [[package]]
name = "quick-xml" name = "quick-xml"
version = "0.23.1" version = "0.28.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "11bafc859c6815fbaffbbbf4229ecb767ac913fecb27f9ad4343662e9ef099ea" checksum = "0ce5e73202a820a31f8a0ee32ada5e21029c81fd9e3ebf668a40832e4219d9d1"
dependencies = [ dependencies = [
"memchr", "memchr",
"serde", "serde",

View file

@ -41,7 +41,7 @@ parking_lot = { version = "0.12", features = ["deadlock_detection"] }
pbkdf2 = { version = "0.12", default-features = false, features = ["hmac"] } pbkdf2 = { version = "0.12", default-features = false, features = ["hmac"] }
priority-queue = "1.2" priority-queue = "1.2"
protobuf = "3" protobuf = "3"
quick-xml = { version = "0.23", features = ["serialize"] } quick-xml = { version = "0.28", features = ["serialize"] }
rand = "0.8" rand = "0.8"
rsa = "0.8.2" rsa = "0.8.2"
serde = { version = "1.0", features = ["derive"] } serde = { version = "1.0", features = ["derive"] }

View file

@ -309,19 +309,17 @@ impl Session {
let mut user_attributes: UserAttributes = HashMap::new(); let mut user_attributes: UserAttributes = HashMap::new();
loop { loop {
match reader.read_event(&mut buf) { match reader.read_event_into(&mut buf) {
Ok(Event::Start(ref element)) => { Ok(Event::Start(ref element)) => {
current_element = std::str::from_utf8(element.name())?.to_owned() current_element = std::str::from_utf8(element)?.to_owned()
} }
Ok(Event::End(_)) => { Ok(Event::End(_)) => {
current_element = String::new(); current_element = String::new();
} }
Ok(Event::Text(ref value)) => { Ok(Event::Text(ref value)) => {
if !current_element.is_empty() { if !current_element.is_empty() {
let _ = user_attributes.insert( let _ = user_attributes
current_element.clone(), .insert(current_element.clone(), value.unescape()?.to_string());
value.unescape_and_decode(&reader)?,
);
} }
} }
Ok(Event::Eof) => break, Ok(Event::Eof) => break,