Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: jruby/jruby
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 78b009c13a61
Choose a base ref
...
head repository: jruby/jruby
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 35e537c48c3d
Choose a head ref
  • 3 commits
  • 4 files changed
  • 1 contributor

Commits on May 26, 2015

  1. Copy the full SHA
    fb5925a View commit details
  2. Copy the full SHA
    6883d18 View commit details
  3. Copy the full SHA
    35e537c View commit details
5 changes: 4 additions & 1 deletion core/src/main/java/org/jruby/ext/socket/RubySocket.java
Original file line number Diff line number Diff line change
@@ -334,8 +334,9 @@ public static IRubyObject ip_address_list(ThreadContext context, IRubyObject sel
@JRubyMethod(name = {"socketpair", "pair"}, meta = true)
public static IRubyObject socketpair(ThreadContext context, IRubyObject recv, IRubyObject domain, IRubyObject type, IRubyObject protocol) {
ProtocolFamily pf = SocketUtils.protocolFamilyFromArg(protocol);
if (pf == null ) pf = ProtocolFamily.PF_UNIX;

if (pf != pf.PF_UNIX) {
if (pf != ProtocolFamily.PF_UNIX && pf.ordinal() != 0) {
throw context.runtime.newErrnoEOPNOTSUPPError("Socket.socketpair only supports streaming UNIX sockets");
}

@@ -345,7 +346,9 @@ public static IRubyObject socketpair(ThreadContext context, IRubyObject recv, IR
@JRubyMethod(name = {"socketpair", "pair"}, meta = true)
public static IRubyObject socketpair(ThreadContext context, IRubyObject recv, IRubyObject domain, IRubyObject type) {
AddressFamily af = SocketUtils.addressFamilyFromArg(domain);
if (af == null) af = AddressFamily.AF_UNIX;
Sock s = SocketUtils.sockFromArg(type);
if (s == null) s = Sock.SOCK_STREAM;

if (af != AddressFamily.AF_UNIX || s != Sock.SOCK_STREAM) {
throw context.runtime.newErrnoEOPNOTSUPPError("Socket.socketpair only supports streaming UNIX sockets");
2 changes: 1 addition & 1 deletion spec/ruby/library/socket/shared/socketpair.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
describe :socket_socketpair, :shared => true do
not_supported_on :jruby, :windows do
not_supported_on :windows do
it "ensures the returned sockets are connected" do
s1, s2 = Socket.socketpair(Socket::AF_UNIX, 1, 0)
s1.puts("test")
1 change: 0 additions & 1 deletion spec/tags/ruby/library/socket/socket/pair_tags.txt

This file was deleted.

1 change: 0 additions & 1 deletion spec/tags/ruby/library/socket/socket/socketpair_tags.txt

This file was deleted.