-
Notifications
You must be signed in to change notification settings - Fork 824
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added a fix so that closed sockets do not cause errors #4548
Conversation
#[derive(Debug)] | ||
struct SocketBufferState { | ||
buffer: RingBuffer<'static, u8>, | ||
push_handler: Option<ArcInterestHandler>, | ||
pull_handler: Option<ArcInterestHandler>, | ||
wakers: Vec<Waker>, | ||
dead: bool, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix this
Closed, | ||
Shutdown, | ||
} | ||
|
||
#[derive(Debug)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix this
@@ -42,8 +50,12 @@ pub(crate) struct SocketBuffer { | |||
|
|||
impl Drop for SocketBuffer { | |||
fn drop(&mut self) { | |||
if self.dead_on_drop { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix this
@@ -42,8 +50,12 @@ pub(crate) struct SocketBuffer { | |||
|
|||
impl Drop for SocketBuffer { | |||
fn drop(&mut self) { | |||
if self.dead_on_drop { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix this
@@ -56,7 +68,7 @@ impl SocketBuffer { | |||
push_handler: None, | |||
pull_handler: None, | |||
wakers: Vec::new(), | |||
dead: false, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix this
@@ -65,7 +77,7 @@ impl SocketBuffer { | |||
|
|||
pub fn set_push_handler(&self, mut handler: ArcInterestHandler) { | |||
let mut state = self.state.lock().unwrap(); | |||
if state.dead { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix this
@@ -76,7 +88,7 @@ impl SocketBuffer { | |||
|
|||
pub fn set_pull_handler(&self, mut handler: ArcInterestHandler) { | |||
let mut state = self.state.lock().unwrap(); | |||
if state.dead { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix this
No description provided.