Project

General

Profile

Actions

Bug #13280

closed

net/ftp: Putbinaryfile (on Windows) requires blocksize equal to file size

Added by MarkDBlackwell (Mark D Blackwell) about 7 years ago. Updated almost 7 years ago.

Status:
Rejected
Target version:
-
[ruby-core:79908]

Description

I searched this issue list (for Descriptions including ftp), but didn't find this problem discussed.

Recently, in the process of developing a new program, I invoked putbinaryfile (in passive mode) on a large file (about 1.3 megabytes) without specifying its blocksize argument. Invariably, the server terminated the transfer about five seconds after its start. (BTW, this approximates the duration in which other FTP clients completely send this entire file—with my setup.)

Much smaller files transferred fine.

Eventually, using a test file of about 63 kilobytes, I discovered that if I specified a blocksize identical to the file length (in bytes), it worked. And the transfer failed when the blocksize was one byte smaller.

Now, I've added code (in my own program) in order to obtain the file size of every file I want to send, and set the blocksize argument to that size (exactly). (Except that, for empty files, I need to set it to 1: otherwise it hangs.)

Since then, I've sent hundreds of files (many of which are approximately 1 or 2 megabytes in size) without experiencing this problem.

Why should I need to set the blocksize in this way? It seems undocumented, to say the least.

I'm on Windows 7 — and I'm using an old version of Ruby (for the moment). Nevertheless, (supposedly) this problem may still exist:

> ruby -v
ruby 2.2.4p230 (2015-12-16 revision 53155) [x64-mingw32]

Updated by shyouhei (Shyouhei Urabe) about 7 years ago

  • Status changed from Open to Assigned
  • Assignee set to shugo (Shugo Maeda)

Updated by shugo (Shugo Maeda) about 7 years ago

I couldn't reproduce the problem in any of 2.2.4p230 (x86_64-linux), 2.3.3p222 (x86_64-linux),
2.4.0p0 (x86_64-linux), and 2.3.3p222 (x64-mingw32).

Could you send us debug output by setting Net::FTP#debug_mode to true?
Make sure the output doesn't contain any sensitive information.

Updated by MarkDBlackwell (Mark D Blackwell) almost 7 years ago

Just now, I returned to my client's site. I couldn't reproduce the problematic reported behavior, either. (And the Windows and Ruby versions remain unchanged.)

Presumably, some system misconfiguration (such as, Ping packets being blocked somewhere by a firewall?) has since been corrected.

Updated by shugo (Shugo Maeda) almost 7 years ago

  • Status changed from Assigned to Rejected

MarkDBlackwell (Mark D Blackwell) wrote:

Just now, I returned to my client's site. I couldn't reproduce the problematic reported behavior, either. (And the Windows and Ruby versions remain unchanged.)

Presumably, some system misconfiguration (such as, Ping packets being blocked somewhere by a firewall?) has since been corrected.

So I close this issue. Thanks.

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0