Skip to content
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

Merged
merged 4 commits into from
Apr 15, 2024

Conversation

john-sharratt
Copy link
Contributor

No description provided.

@theduke theduke merged commit 03a31f7 into master Apr 15, 2024
55 of 59 checks passed
@theduke theduke deleted the socket-close-fix branch April 15, 2024 15:14
#[derive(Debug)]
struct SocketBufferState {
buffer: RingBuffer<'static, u8>,
push_handler: Option<ArcInterestHandler>,
pull_handler: Option<ArcInterestHandler>,
wakers: Vec<Waker>,
dead: bool,

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)]

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 {

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 {

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,

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 {

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 {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants