mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2025-02-17 05:15:14 +00:00
reqwesthttpsrc/s3: Unlock canceller while waiting for the future to be resolved
Otherwise nothing can ever access the canceller and unlocking does not work. meh
This commit is contained in:
parent
69aefb15f7
commit
e90099bad3
2 changed files with 7 additions and 3 deletions
|
@ -436,6 +436,7 @@ impl ReqwestHttpSrc {
|
|||
let (sender, receiver) = oneshot::channel::<Bytes>();
|
||||
|
||||
canceller.replace(sender);
|
||||
drop(canceller);
|
||||
|
||||
// wrapping timeout around future
|
||||
let future_timeout = if timeout == 0 {
|
||||
|
@ -463,6 +464,7 @@ impl ReqwestHttpSrc {
|
|||
});
|
||||
|
||||
/* Clear out the canceller */
|
||||
canceller = self.canceller.lock().unwrap();
|
||||
*canceller = None;
|
||||
|
||||
res
|
||||
|
|
|
@ -20,10 +20,11 @@ where
|
|||
F: Send + Future<Error = gst::ErrorMessage> + 'static,
|
||||
F::Item: Send,
|
||||
{
|
||||
let mut canceller = canceller.lock().unwrap();
|
||||
let mut canceller_guard = canceller.lock().unwrap();
|
||||
let (sender, receiver) = oneshot::channel::<T>();
|
||||
|
||||
canceller.replace(sender);
|
||||
canceller_guard.replace(sender);
|
||||
drop(canceller_guard);
|
||||
|
||||
let unlock_error = gst_error_msg!(gst::ResourceError::Busy, ["unlock"]);
|
||||
|
||||
|
@ -40,7 +41,8 @@ where
|
|||
});
|
||||
|
||||
/* Clear out the canceller */
|
||||
*canceller = None;
|
||||
canceller_guard = canceller.lock().unwrap();
|
||||
*canceller_guard = None;
|
||||
|
||||
res
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue