Project

General

Profile

Bug #11260

[PATCH] Net::FTP keeps a TCPServer opened when sending the data port fails

Added by Eregon (Benoit Daloze) over 4 years ago. Updated about 4 years ago.

Status:
Closed
Priority:
Normal
Target version:
-
ruby -v:
ruby 2.2.2p95 (2015-04-13 revision 50295) [x86_64-linux]
[ruby-core:69577]

Description

Net::FTP will keep the TCPServer created in makeport opened if sendport fails.
The patch sends the port in its (only) caller instead, so the TCPServer is appropriately closed no matter the outcome.

This was detected with RubySpec and a leak checker based on test/lib/leakchecker.rb.


Files

Associated revisions

Revision b76dad51
Added by nagachika (Tomoyuki Chikanaga) about 4 years ago

merge revision(s) 51046: [Backport #11260]

    * lib/net/ftp.rb (makeport): close the TCPServer
      when sending the port fails.

    * test/net/ftp/test_ftp.rb: test for above.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_2@51556 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Revision 51556
Added by nagachika (Tomoyuki Chikanaga) about 4 years ago

merge revision(s) 51046: [Backport #11260]

* lib/net/ftp.rb (makeport): close the TCPServer
  when sending the port fails.

* test/net/ftp/test_ftp.rb: test for above.

Revision 190241f3
Added by usa (Usaku NAKAMURA) about 4 years ago

merge revision(s) 51046: [Backport #11260]

    * lib/net/ftp.rb (makeport): close the TCPServer
      when sending the port fails.

    * test/net/ftp/test_ftp.rb: test for above.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_1@51610 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Revision 51610
Added by usa (Usaku NAKAMURA) about 4 years ago

merge revision(s) 51046: [Backport #11260]

* lib/net/ftp.rb (makeport): close the TCPServer
  when sending the port fails.

* test/net/ftp/test_ftp.rb: test for above.

History

Updated by shugo (Shugo Maeda) over 4 years ago

  • Status changed from Open to Assigned
  • Assignee changed from shugo (Shugo Maeda) to Eregon (Benoit Daloze)

Benoit Daloze wrote:

shugo (Shugo Maeda), can I commit this?

The patch looks fine. Please commit it.

Updated by Eregon (Benoit Daloze) over 4 years ago

  • Status changed from Assigned to Closed

Thanks, committed in r51046.

Updated by usa (Usaku NAKAMURA) over 4 years ago

  • Backport changed from 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN to 2.0.0: WONTFIX, 2.1: REQUIRED, 2.2: REQUIRED
#5

Updated by nagachika (Tomoyuki Chikanaga) about 4 years ago

  • Backport changed from 2.0.0: WONTFIX, 2.1: REQUIRED, 2.2: REQUIRED to 2.0.0: WONTFIX, 2.1: REQUIRED, 2.2: DONE

Backported into ruby_2_2 branch at r51556.

#6

Updated by usa (Usaku NAKAMURA) about 4 years ago

  • Backport changed from 2.0.0: WONTFIX, 2.1: REQUIRED, 2.2: DONE to 2.0.0: WONTFIX, 2.1: DONE, 2.2: DONE

ruby_2_1 r51610 merged revision(s) 51046.

Also available in: Atom PDF