diff --git a/pmomediaserver/src/contentdirectory/handlers.rs b/pmomediaserver/src/contentdirectory/handlers.rs
index 413f09f6..b80d307a 100644
--- a/pmomediaserver/src/contentdirectory/handlers.rs
+++ b/pmomediaserver/src/contentdirectory/handlers.rs
@@ -26,7 +26,7 @@
use crate::content_handler::ContentHandler;
use pmoupnp::actions::{ActionError, ActionHandler};
use pmoupnp::{action_handler, get, set};
-use tracing::{debug, error};
+use tracing::{debug, error, info};
/// Handler pour l'action Browse.
///
@@ -61,6 +61,11 @@ pub fn browse_handler() -> ActionHandler {
let _filter: String = get!(&data, "Filter", String);
let _sort_criteria: String = get!(&data, "SortCriteria", String);
+ info!(
+ "π Browse requested: object_id={} flag={} start={} count={}",
+ object_id, browse_flag, starting_index, requested_count
+ );
+
// Appeler la logique mΓ©tier
let (didl, returned, total, update_id) = handler
.browse(&object_id, &browse_flag, starting_index, requested_count)
@@ -80,6 +85,10 @@ pub fn browse_handler() -> ActionHandler {
"β
Browse completed: returned={}, total={}",
returned, total
);
+ info!(
+ "π Browse completed: object_id={} returned={} total={}",
+ object_id, returned, total
+ );
Ok(data)
})
}
diff --git a/pmoupnp/src/ssdp/server.rs b/pmoupnp/src/ssdp/server.rs
index 1b12a238..7df4bf43 100644
--- a/pmoupnp/src/ssdp/server.rs
+++ b/pmoupnp/src/ssdp/server.rs
@@ -5,7 +5,7 @@ use std::collections::HashMap;
use std::net::{SocketAddr, UdpSocket};
use std::sync::{Arc, RwLock};
use std::time::Duration;
-use tracing::{info, warn};
+use tracing::{debug, info, warn};
/// Serveur SSDP gΓ©rant les annonces et dΓ©couvertes
pub struct SsdpServer {
@@ -62,6 +62,17 @@ impl SsdpServer {
devices.insert(uuid.clone(), device.clone());
drop(devices);
+ info!(
+ "π SSDP device registered: {} ({} NTs)",
+ uuid,
+ device.get_notification_types().len()
+ );
+ debug!(
+ "π SSDP device notification types for {}: {:?}",
+ uuid,
+ device.get_notification_types()
+ );
+
// Envoyer alive pour tous les NTs
if let Some(ref socket) = self.socket {
for nt in device.get_notification_types() {
@@ -76,6 +87,12 @@ impl SsdpServer {
if let Some(device) = devices.remove(uuid) {
drop(devices);
+ info!(
+ "ποΈ SSDP device removed: {} ({} NTs)",
+ uuid,
+ device.get_notification_types().len()
+ );
+
// Envoyer byebye pour tous les NTs
if let Some(ref socket) = self.socket {
for nt in device.get_notification_types() {
@@ -111,7 +128,13 @@ impl SsdpServer {
.unwrap();
match socket.send_to(msg.as_bytes(), addr) {
- Ok(_) => info!("β
NOTIFY alive: {} (NT={})", usn, nt),
+ Ok(_) => {
+ info!("β
NOTIFY alive: {} (NT={})", usn, nt);
+ debug!(
+ "π£ NOTIFY alive payload\n\n\n```\n{}\n```\n \n",
+ msg
+ );
+ }
Err(e) => warn!("β Failed to send NOTIFY alive for {}: {}", usn, e),
}
}
@@ -139,7 +162,13 @@ impl SsdpServer {
.unwrap();
match socket.send_to(msg.as_bytes(), addr) {
- Ok(_) => info!("π NOTIFY byebye: {} (NT={})", usn, nt),
+ Ok(_) => {
+ info!("π NOTIFY byebye: {} (NT={})", usn, nt);
+ debug!(
+ "π£ NOTIFY byebye payload\n\n\n```\n{}\n```\n \n",
+ msg
+ );
+ }
Err(e) => warn!("β Failed to send NOTIFY byebye for {}: {}", usn, e),
}
}
@@ -151,6 +180,7 @@ impl SsdpServer {
std::thread::spawn(move || {
loop {
+ debug!("β° SSDP periodic announcement tick");
std::thread::sleep(period);
let devices = devices.read().unwrap();
@@ -189,7 +219,13 @@ impl SsdpServer {
.unwrap();
match socket.send_to(msg.as_bytes(), addr) {
- Ok(_) => info!("β
NOTIFY alive (periodic): {} (NT={})", usn, nt),
+ Ok(_) => {
+ info!("β
NOTIFY alive (periodic): {} (NT={})", usn, nt);
+ debug!(
+ "π£ NOTIFY alive (periodic) payload\n\n\n```\n{}\n```\n \n",
+ msg
+ );
+ }
Err(e) => warn!("β Failed to send periodic NOTIFY alive for {}: {}", usn, e),
}
}
@@ -205,6 +241,10 @@ impl SsdpServer {
Ok((n, src)) => {
let data = String::from_utf8_lossy(&buf[..n]);
if data.starts_with("M-SEARCH") {
+ debug!(
+ "π M-SEARCH received from {}\n\n\n```\n{}\n```\n \n",
+ src, data
+ );
if let Some(st) = Self::parse_st(&data) {
let devices = devices.read().unwrap();
for device in devices.values() {
@@ -270,12 +310,14 @@ impl SsdpServer {
\r\n",
MAX_AGE, date, device.location, device.server, nt, usn
);
-
match socket.send_to(resp.as_bytes(), src) {
- Ok(_) => info!(
- "π‘ M-SEARCH response sent to {} with ST={}\n\n\n```\n{}\n```\n \n",
- src, nt, resp
- ),
+ Ok(_) => {
+ info!("π‘ M-SEARCH response sent to {} with ST={}", src, nt);
+ debug!(
+ "π‘ M-SEARCH response payload\n\n\n```\n{}\n```\n \n",
+ resp
+ );
+ }
Err(e) => warn!("β Failed to send M-SEARCH response to {}: {}", src, e),
}
}