Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Modified fix for Pull Request #85 jruby#85

  • Loading branch information...
commit 9dcd3885dd165f04df36f1879da013855131a9ba 1 parent 53052f0
Hiro Asari BanzaiMan authored

Showing 1 changed file with 2 additions and 1 deletion. Show diff stats Hide diff stats

  1. +2 1  src/org/jruby/ext/socket/RubySocket.java
3  src/org/jruby/ext/socket/RubySocket.java
@@ -509,8 +509,9 @@ public static IRubyObject pack_sockaddr_in(IRubyObject recv, IRubyObject port, I
509 509 }
510 510 @JRubyMethod(name = {"pack_sockaddr_in", "sockaddr_in"}, meta = true)
511 511 public static IRubyObject pack_sockaddr_in(ThreadContext context, IRubyObject recv, IRubyObject port, IRubyObject host) {
  512 + int portNum = port instanceof RubyString ? Integer.parseInt(port.convertToString().toString()): RubyNumeric.fix2int(port);
512 513 return pack_sockaddr_in(context, recv,
513   - RubyNumeric.fix2int(port),
  514 + portNum,
514 515 host.isNil() ? null : host.convertToString().toString());
515 516 }
516 517 public static IRubyObject pack_sockaddr_in(ThreadContext context, IRubyObject recv, int iport, String host) {

0 comments on commit 9dcd388

Please sign in to comment.
Something went wrong with that request. Please try again.