Fix a bug in mDNS

This commit is contained in:
ivmarkov 2023-06-01 04:59:01 +00:00
parent b94484b67e
commit 8e9d8887da

View file

@ -392,9 +392,9 @@ pub mod builtin {
impl MdnsEntry {
#[inline(always)]
const fn new() -> Self {
const fn new(key: heapless::String<64>) -> Self {
Self {
key: heapless::String::new(),
key,
record: heapless::Vec::new(),
}
}
@ -479,7 +479,7 @@ pub mod builtin {
entries.retain(|entry| entry.key != key);
entries
.push(MdnsEntry::new())
.push(MdnsEntry::new(key))
.map_err(|_| ErrorCode::NoSpace)?;
let entry = entries.iter_mut().last().unwrap();