Skip to content

Commit

Permalink
reduce SearchStopped notification send error to warn (#178)
Browse files Browse the repository at this point in the history
It is possible that the client is already dropped after requesting stop search. Hence such send failure is not a critical error.
  • Loading branch information
keepsimple1 authored Feb 28, 2024
1 parent 4d719a3 commit 42c94bb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/service_daemon.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
// in Service Discovery, the basic data structure is "Service Info". One Service Info
// corresponds to a set of DNS Resource Records.
#[cfg(feature = "logging")]
use crate::log::{debug, error};
use crate::log::{debug, error, warn};
use crate::{
dns_parser::{
current_time_millis, DnsAddress, DnsIncoming, DnsOutgoing, DnsPointer, DnsRecordBox,
Expand Down Expand Up @@ -645,7 +645,7 @@ impl ServiceDaemon {
// Notify the client.
match sender.send(ServiceEvent::SearchStopped(ty_domain)) {
Ok(()) => debug!("Sent SearchStopped to the listener"),
Err(e) => error!("Failed to send SearchStopped: {}", e),
Err(e) => warn!("Failed to send SearchStopped: {}", e),
}
}
},
Expand Down

0 comments on commit 42c94bb

Please sign in to comment.