-
Notifications
You must be signed in to change notification settings - Fork 229
Fix SelectInterruptPipe::read() being called with fd -1 #573
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||
|---|---|---|---|---|
|
|
@@ -20,7 +20,6 @@ | |||
| #include <linux/in.h> | ||||
| #include <linux/tcp.h> | ||||
| #endif | ||||
| #include <ixwebsocket/IXSelectInterruptFactory.h> | ||||
|
|
||||
| namespace ix | ||||
| { | ||||
|
|
@@ -67,8 +66,7 @@ namespace ix | |||
|
|
||||
| int timeoutMs = 10; | ||||
| bool readyToRead = false; | ||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think it's because we don't call init() on that object.
Can you try that, this should become a one liner fix.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Would this be needed at this stage? As far as I understand from the code the |
||||
| SelectInterruptPtr selectInterrupt = ix::createSelectInterrupt(); | ||||
| PollResultType pollResult = Socket::poll(readyToRead, timeoutMs, fd, selectInterrupt); | ||||
| PollResultType pollResult = Socket::poll(readyToRead, timeoutMs, fd, nullptr); | ||||
|
|
||||
| if (pollResult == PollResultType::Timeout) | ||||
| { | ||||
|
|
||||
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.
What's wrong with ret for a variable name ?
Uh oh!
There was an error while loading. Please reload this page.
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.
Nothing inherently wrong, just gave me the impression that it will be used as the return value for the whole function at first. Just makes the code a bit faster to read for me.
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.
Ok. In general it's better to keep PR to the minimum viable change, this is just marginally better and debatable, it's about taste I like short names better as long as they aren't cryptic like x.