Bug #223

Net::FTP#sendport incompatible with Mathn library

Added by NoKarma (Arthur Schreiber) almost 4 years ago. Updated about 1 year ago.

[ruby-core:17557]
Status:Closed Start date:07/04/2008
Priority:Normal Due date:
Assignee:- % Done:

100%

Category:-
Target version:-
ruby -v:

Description

The Mathn library modifies the #/ Operator to return a Rational instead of an Integer. But Net::FTP#sendport relies on getting an Integer and not a Rational value. Using #div instead of #/ for division fixes this error.



@ftp.send(:sendport, "192.168.0.1", 1234)

writes "PORT 192,168,0,1,4,210\r\n" to the socket

require "mathn"
@ftp.send(:sendport, "192.168.0.1", 1234)

writes "PORT 192,168,0,1,617/128,210\r\n" to the socket.

net_ftp_sendport_fix.patch (430 Bytes) NoKarma (Arthur Schreiber), 07/04/2008 02:21 am

Associated revisions

Revision 17868
Added by nobu almost 4 years ago

* lib/net/ftp.rb (Net::FTP#sendport): use divmod. [ruby-core:17557]

History

Updated by nobu (Nobuyoshi Nakada) almost 4 years ago

  • Status changed from Open to Closed
  • % Done changed from 0 to 100
Applied in changeset r17868.

Also available in: Atom PDF