1
0
mirror of https://github.com/moparisthebest/curl synced 2025-02-28 09:21:50 -05:00

Provide support for "transferring" zero bytes FTP files and comparing that

the output file actually is zero bytes after the transfer.
This commit is contained in:
Daniel Stenberg 2004-08-23 14:40:43 +00:00
parent d736ac51c0
commit 464be27479
3 changed files with 10 additions and 4 deletions

View File

@ -14,8 +14,8 @@ specified, that will be checked/used if specified. This document includes all
the subsections currently supported.
<reply>
<data [nocheck=1]>
data to sent to the client on its request and later verified that it arrived
<data [nocheck=1] [sendzero=yes]>
§data to sent to the client on its request and later verified that it arrived
safely. Set the nocheck=1 to prevent the test script to verify the arrival
of this data.
@ -27,6 +27,10 @@ If the data contains 'swsbounce' anywhere within the start and end tag, the
HTTP server will detect if this is a second request using the same test and
part number and will then increase the part number with one. This is useful
for auth tests and similar.
'sendzero' set to yes means that the (FTP) server will "send" the data even if
the size is zero bytes. Used to verify curl's behaviour on zero bytes
transfers.
</data>
<dataNUM>
Send back this contents instead of the <data> one. The num is set by:

View File

@ -318,7 +318,9 @@ sub RETR_command {
$size += length($_);
}
if($size) {
my %hash = getpartattr("reply", "data");
if($size || $hash{'sendzero'}) {
if($rest) {
# move read pointer forward

View File

@ -1147,7 +1147,7 @@ sub singletest {
}
my %replyattr = getpartattr("reply", "data");
if(!$replyattr{'nocheck'} && @reply) {
if(!$replyattr{'nocheck'} && (@reply || $replyattr{'sendzero'})) {
# verify the received data
my @out = loadarray($CURLOUT);
$res = compare("data", \@out, \@reply);