mirror of
https://github.com/scottlamb/moonfire-nvr.git
synced 2025-12-04 06:35:58 -05:00
upgrade to hyper/http 1.0
In the process, no longer wait for pending HTTP requests on shutdown. This just extended the time Moonfire was running without streaming.
This commit is contained in:
@@ -147,6 +147,18 @@ impl<'receiver> Future for ReceiverRefFuture<'receiver> {
|
||||
}
|
||||
}
|
||||
|
||||
impl Drop for ReceiverRefFuture<'_> {
|
||||
fn drop(&mut self) {
|
||||
if self.waker_i == NO_WAKER {
|
||||
return;
|
||||
}
|
||||
let mut l = self.receiver.0.wakers.lock().unwrap();
|
||||
if let Some(wakers) = &mut *l {
|
||||
wakers.remove(self.waker_i);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl Future for ReceiverFuture {
|
||||
type Output = ();
|
||||
|
||||
@@ -156,6 +168,18 @@ impl Future for ReceiverFuture {
|
||||
}
|
||||
}
|
||||
|
||||
impl Drop for ReceiverFuture {
|
||||
fn drop(&mut self) {
|
||||
if self.waker_i == NO_WAKER {
|
||||
return;
|
||||
}
|
||||
let mut l = self.receiver.wakers.lock().unwrap();
|
||||
if let Some(wakers) = &mut *l {
|
||||
wakers.remove(self.waker_i);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Returns a sender and receiver for graceful shutdown.
|
||||
///
|
||||
/// Dropping the sender will request shutdown.
|
||||
|
||||
Reference in New Issue
Block a user