Browse files

Modified fix for Pull Request #85 jruby#85

  • Loading branch information...
1 parent 53052f0 commit 9dcd3885dd165f04df36f1879da013855131a9ba @BanzaiMan BanzaiMan committed Oct 24, 2011
Showing with 2 additions and 1 deletion.
  1. +2 −1 src/org/jruby/ext/socket/RubySocket.java
View
3 src/org/jruby/ext/socket/RubySocket.java
@@ -509,8 +509,9 @@ public static IRubyObject pack_sockaddr_in(IRubyObject recv, IRubyObject port, I
}
@JRubyMethod(name = {"pack_sockaddr_in", "sockaddr_in"}, meta = true)
public static IRubyObject pack_sockaddr_in(ThreadContext context, IRubyObject recv, IRubyObject port, IRubyObject host) {
+ int portNum = port instanceof RubyString ? Integer.parseInt(port.convertToString().toString()): RubyNumeric.fix2int(port);
return pack_sockaddr_in(context, recv,
- RubyNumeric.fix2int(port),
+ portNum,
host.isNil() ? null : host.convertToString().toString());
}
public static IRubyObject pack_sockaddr_in(ThreadContext context, IRubyObject recv, int iport, String host) {

0 comments on commit 9dcd388

Please sign in to comment.