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

Socket#setsockopt broken with nil or false value. #1460

Closed
ioquatix opened this issue Nov 7, 2018 · 6 comments
Closed

Socket#setsockopt broken with nil or false value. #1460

ioquatix opened this issue Nov 7, 2018 · 6 comments
Assignees

Comments

@ioquatix
Copy link
Contributor

ioquatix commented Nov 7, 2018

If optval is false, it would fail to match correctly. Proposed fix:

  def setsockopt(level_or_option, optname = nil, optval = nil)
    if level_or_option and optname
@ioquatix
Copy link
Contributor Author

ioquatix commented Nov 7, 2018

I worked around this issue by ensuring I only call this function with optval = 1.

@ioquatix
Copy link
Contributor Author

ioquatix commented Dec 6, 2018

The Ruby documentation specifically allows true/false just FYI.

@ioquatix
Copy link
Contributor Author

ioquatix commented Jun 7, 2019

@eregon has this been fixed yet?

@eregon
Copy link
Member

eregon commented Jun 7, 2019

I'm not sure, I'll take a look.

@eregon eregon self-assigned this Jun 7, 2019
@eregon
Copy link
Member

eregon commented Jun 12, 2019

We already have a failing spec for this, great:
BasicSocket#setsockopt sets the socket option Socket::SO_OOBINLINE

@sock.setsockopt(Socket::SOL_SOCKET, Socket::SO_OOBINLINE, false).should == 0

@eregon eregon added this to the 20.0.0-beta2 milestone Jun 13, 2019
@eregon
Copy link
Member

eregon commented Jun 13, 2019

@ioquatix I fixed this in 2465104, thanks for the bug report!

@eregon eregon closed this as completed Jun 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants