curl-curl/tests/data/test637
Daniel Stenberg c545e10fa7
sftp: fix range downloads in both SSH backends
When asking for the last N bytes of a file, and that size was larger
than the file size, it would miss the first byte due to a logic error.

The fixed range parser is now made a common function in the file now
renamed to vssh.c (from curl_path.c) - used by both backends.

Unit test 2605 verifies the parser.

Reported-by: Stanislav Fort (Aisle Research)
Closes #19460
2025-11-11 14:51:22 +01:00

42 lines
592 B
Plaintext

<testcase>
<info>
<keywords>
SFTP
Range
</keywords>
</info>
#
# Server-side
<reply>
<data>
</data>
</reply>
#
# Client-side
<client>
<server>
sftp
</server>
<name>
SFTP retrieval with invalid X- range
</name>
<command>
--key %LOGDIR/server/curl_client_key --pubkey %LOGDIR/server/curl_client_key.pub -u %USER: sftp://%HOSTIP:%SSHPORT%SFTP_PWD/%LOGDIR/file%TESTNUMBER.txt -r 99- --insecure
</command>
<file name="%LOGDIR/file%TESTNUMBER.txt">
Test data
for ssh test
</file>
</client>
#
# Verify data after the test has been "shot"
<verify>
<errorcode>
33
</errorcode>
</verify>
</testcase>