[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Bug-wget] [PATCH v5 2/4] Tests: fix TYPE and RETR command handling.
From: |
Yousong Zhou |
Subject: |
Re: [Bug-wget] [PATCH v5 2/4] Tests: fix TYPE and RETR command handling. |
Date: |
Fri, 14 Feb 2014 10:33:10 +0800 |
Please use this newly sent one of this patch. The old one is incorrect.
On 14 February 2014 10:27, Yousong Zhou <address@hidden> wrote:
> diff --git a/tests/FTPServer.pm b/tests/FTPServer.pm
> index 2ac72e3..1603caa 100644
> --- a/tests/FTPServer.pm
> +++ b/tests/FTPServer.pm
> @@ -298,12 +298,13 @@ sub _RETR_command
> # What mode are we sending this file in?
> unless ($conn->{type} eq 'A') # Binary type.
> {
> - my ($r, $buffer, $n, $w);
> -
> + my ($r, $buffer, $n, $w, $sent);
>
> # Copy data.
> - while ($buffer = substr($content, 0, 65536))
> + $sent = 0;
> + while ($sent < length($content))
> {
> + $buffer = substr($content, $sent, 65536);
It was:
$buffer = substr($content, 0, 65536);
>
> $r = length $buffer;
>
> # Restart alarm clock timer.
yousong