From b267127de4552a72ddf79ffa9391bed33b758104 Mon Sep 17 00:00:00 2001 From: Wayne Conrad Date: Mon, 25 Jan 2016 13:08:09 -0700 Subject: [PATCH 1/3] active mode transfers work in ruby-2.3.0 --- lib/double_bag_ftps.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/double_bag_ftps.rb b/lib/double_bag_ftps.rb index f70d4fb..d8d25c7 100644 --- a/lib/double_bag_ftps.rb +++ b/lib/double_bag_ftps.rb @@ -109,6 +109,10 @@ def transfercmd(cmd, rest_offset = nil) conn = ssl_socket(conn) # SSL connection now possible after cmd sent else sock = makeport + # Before ruby-2.3.0, makeport did a sendport automatically + if RUBY_VERSION >= "2.3" + sendport(sock.addr[3], sock.addr[1]) + end if @resume and rest_offset resp = sendcmd('REST ' + rest_offset.to_s) if resp[0] != ?3 From d681c13c519a16bb2ec1e530ca274b178d165c9a Mon Sep 17 00:00:00 2001 From: Wayne Conrad Date: Wed, 6 Apr 2016 10:36:23 -0700 Subject: [PATCH 2/3] active mode transers work in ruby >= 2.2.3 This extends the previous patch, which worked for 2.3. The changes to ftp.rb in ruby 2.3 which broke double-bag-ftps have apparently been back-ported to 2.2 starting with 2.2.3. The `require 'rubygems'` is needed for this patch to work with Ruby 1.8. --- lib/double_bag_ftps.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/double_bag_ftps.rb b/lib/double_bag_ftps.rb index d8d25c7..cd4c6f1 100644 --- a/lib/double_bag_ftps.rb +++ b/lib/double_bag_ftps.rb @@ -1,4 +1,5 @@ require 'net/ftp' +require 'rubygems' begin require 'openssl' rescue LoadError @@ -109,8 +110,8 @@ def transfercmd(cmd, rest_offset = nil) conn = ssl_socket(conn) # SSL connection now possible after cmd sent else sock = makeport - # Before ruby-2.3.0, makeport did a sendport automatically - if RUBY_VERSION >= "2.3" + # Before ruby-2.2.3, makeport did a sendport automatically + if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new("2.2.3") sendport(sock.addr[3], sock.addr[1]) end if @resume and rest_offset From f043219021ee9e8038c32116f31f2703defae868 Mon Sep 17 00:00:00 2001 From: Wayne Conrad Date: Thu, 28 Apr 2016 05:05:22 -0700 Subject: [PATCH 3/3] Bump version to 0.1.3 --- CHANGELOG.md | 7 +++++++ double_bag_ftps.gemspec | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ec48566..2a3d6e5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,11 @@ +## 0.1.3 + +Bugfixes: + + - Active mode transfers send proper commands with Ruby > 2.2.2 + ## 0.1.2 + Bugfixes: - Reuse SSL session when creating new sockets diff --git a/double_bag_ftps.gemspec b/double_bag_ftps.gemspec index d49e948..78eb2b2 100644 --- a/double_bag_ftps.gemspec +++ b/double_bag_ftps.gemspec @@ -3,7 +3,7 @@ $:.push File.expand_path("../lib", __FILE__) Gem::Specification.new do |s| s.name = "double-bag-ftps" - s.version = "0.1.2" + s.version = "0.1.3" s.license = "MIT" s.author = "Bryan Nix" s.homepage = "https://github.com/bnix/double-bag-ftps"