Fix UPnP on Sony

This commit is contained in:
Igor Katson 2024-08-24 14:15:01 +01:00
parent a38480e876
commit f4f82ed4b4
No known key found for this signature in database
GPG key ID: B4EC22B66D61A3F5
5 changed files with 47 additions and 17 deletions

View file

@ -29,7 +29,10 @@ use crate::{
};
async fn description_xml(State(state): State<UnpnServerState>) -> impl IntoResponse {
state.rendered_root_description.clone()
(
[(CONTENT_TYPE, CONTENT_TYPE_XML_UTF8)],
state.rendered_root_description.clone(),
)
}
async fn generate_content_directory_control_response(
@ -94,7 +97,6 @@ async fn subscription(
}
let (parts, _body) = request.into_parts();
trace!(?parts.headers, "subscription request");
let is_event = parts
.headers
.get(HeaderName::from_static("nt"))

View file

@ -5,6 +5,16 @@
<minor>0</minor>
</specVersion>
<actionList>
<action>
<name>GetSystemUpdateID</name>
<argumentList>
<argument>
<name>Id</name>
<direction>out</direction>
<relatedStateVariable>SystemUpdateID</relatedStateVariable>
</argument>
</argumentList>
</action>
<action>
<name>Browse</name>
<argumentList>

View file

@ -24,6 +24,7 @@
<serviceId>urn:upnp-org:serviceId:ConnectionManager</serviceId>
<SCPDURL>{http_prefix}/scpd/ConnectionManager.xml</SCPDURL>
<controlURL>{http_prefix}/control/ConnectionManager</controlURL>
<eventSubURL>{http_prefix}/subscribe</eventSubURL>
</service>
</serviceList>
<presentationURL>/</presentationURL>

View file

@ -10,7 +10,7 @@ use std::{
time::Duration,
};
use tokio::sync::{broadcast::error::RecvError, Notify};
use tracing::{error_span, warn, Instrument};
use tracing::{debug, error_span, warn, Instrument};
pub struct Subscription {
pub url: url::Url,
@ -142,7 +142,7 @@ impl UpnpServerStateInner {
)
.await
{
warn!(error=?e, "error updating UPNP subscription");
debug!(error=?e, "error updating UPNP subscription");
}
}
Err(RecvError::Lagged(by)) => {
@ -158,7 +158,7 @@ impl UpnpServerStateInner {
)
.await
{
warn!(error=?e, "error updating UPNP subscription");
debug!(error=?e, "error updating UPNP subscription");
}
}
Err(RecvError::Closed) => return Ok(()),