Enhanced setsockopt parameter handling #2040

Merged
merged 1 commit into from Nov 20, 2012

Conversation

Projects
None yet
2 participants
Contributor

warrenseen commented Nov 20, 2012

Correctly handle the case where a Symbol or String is used instead of a socket
constant for level or optname in calls to BasicSocket#setsockopt.

This behaviour is consistent with MRI, which permits both the level and optname
params to be a string or symbol of the name.

These strings are also allowed to omit the prefix from both the level and the
optname, for example:
:IPPROTO_TCP, "IPROTO_TCP", :TCP, and "TCP" are all considered equivalent to
Socket::Constants::IPPROTO_TCP.

This commit adds support for levels and optnames based on those supported in
the MRI 1.9 socket code.

This resolves an issue preventing capybara-webkit specs from running as part of #2006

Enhanced setsockopt parameter handling
Correctly handle the case where a Symbol or String is used instead of a socket
constant for level or optname in calls to BasicSocket#setsockopt.

This behaviour is consistent with MRI, which permits both the level and optname
params to be a string or symbol of the name.

These strings are also allowed to omit the prefix from both the level and the
optname, for example:
:IPPROTO_TCP, "IPROTO_TCP", :TCP, and "TCP" are all considered equivalent to
Socket::Constants::IPPROTO_TCP.

This commit adds support for levels and optnames based on those supported in
the MRI 1.9 socket code.

@brixen brixen merged commit 8441f27 into rubinius:master Nov 20, 2012

1 check failed

default The Travis build failed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment