diff options
author | Taruntej Kanakamalla <taruntej@asymptotic.io> | 2023-10-06 08:53:03 +0300 |
---|---|---|
committer | GStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org> | 2023-10-06 16:11:46 +0300 |
commit | 245185d2f68a10da3834140175f56f280342f47e (patch) | |
tree | f3407d8b163153a7016b1968101baa088a831dbc | |
parent | e4096b5157f53a04cb18d640c87faae706cd64f0 (diff) |
net/webrtc/whip_signaller: Use the correct URL during redirect
Copy of 90e06dc3 for whipclientsink
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1351>
-rw-r--r-- | net/webrtc/src/whip_signaller/imp.rs | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/net/webrtc/src/whip_signaller/imp.rs b/net/webrtc/src/whip_signaller/imp.rs index 4cfbc126..a483123b 100644 --- a/net/webrtc/src/whip_signaller/imp.rs +++ b/net/webrtc/src/whip_signaller/imp.rs @@ -107,28 +107,37 @@ impl Signaller { ); let timeout; + let endpoint; { let settings = self.settings.lock().unwrap(); timeout = settings.timeout; + endpoint = + reqwest::Url::parse(settings.whip_endpoint.as_ref().unwrap().as_str()).unwrap(); drop(settings); } - if let Err(e) = - wait_async(&self.canceller, self.do_post(offer_sdp, webrtcbin), timeout).await + if let Err(e) = wait_async( + &self.canceller, + self.do_post(offer_sdp, webrtcbin, endpoint), + timeout, + ) + .await { self.handle_future_error(e); } } #[async_recursion] - async fn do_post(&self, offer: gst_webrtc::WebRTCSessionDescription, webrtcbin: &gst::Element) { + async fn do_post( + &self, + offer: gst_webrtc::WebRTCSessionDescription, + webrtcbin: &gst::Element, + endpoint: reqwest::Url, + ) { let auth_token; - let endpoint; { let settings = self.settings.lock().unwrap(); - endpoint = - reqwest::Url::parse(settings.whip_endpoint.as_ref().unwrap().as_str()).unwrap(); auth_token = settings.auth_token.clone(); drop(settings); } @@ -324,7 +333,7 @@ impl Signaller { redirect_url.as_str() ); - self.do_post(offer, webrtcbin).await + self.do_post(offer, webrtcbin, redirect_url).await } Err(e) => self.raise_error(e.to_string()), } |