mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2025-01-12 04:05:24 +00:00
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>
This commit is contained in:
parent
e4096b5157
commit
245185d2f6
1 changed files with 16 additions and 7 deletions
|
@ -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()),
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue