From b8cc7bcd59af84c0a02d264e7729182c4418c756 Mon Sep 17 00:00:00 2001 From: kixelated Date: Tue, 7 Nov 2023 21:14:51 +0900 Subject: [PATCH] Debug logging for the MoQ SETUP too. (#122) --- moq-transport/src/session/client.rs | 3 +++ moq-transport/src/session/server.rs | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/moq-transport/src/session/client.rs b/moq-transport/src/session/client.rs index 2918e46..243fe4e 100644 --- a/moq-transport/src/session/client.rs +++ b/moq-transport/src/session/client.rs @@ -45,10 +45,13 @@ impl Client { }, }; + log::debug!("sending client SETUP: {:?}", client); client.encode(&mut control.0).await?; let mut server = setup::Server::decode(&mut control.1).await?; + log::debug!("received server SETUP: {:?}", server); + match server.version { setup::Version::DRAFT_01 => { // We always require this extension diff --git a/moq-transport/src/session/server.rs b/moq-transport/src/session/server.rs index b41871f..215fe94 100644 --- a/moq-transport/src/session/server.rs +++ b/moq-transport/src/session/server.rs @@ -15,6 +15,8 @@ impl Server { let mut client = setup::Client::decode(&mut control.1).await?; + log::debug!("received client SETUP: {:?}", client); + if client.versions.contains(&setup::Version::DRAFT_01) { // We always require subscriber ID. client.extensions.require_subscriber_id()?; @@ -91,6 +93,8 @@ impl Request { params: Default::default(), }; + log::debug!("sending server SETUP: {:?}", server); + // We need to sure we support the opposite of the client's role. // ex. if the client is a publisher, we must be a subscriber ONLY. if !self.client.role.is_compatible(server.role) {