[
https://issues.apache.org/jira/browse/SSHD-728?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15883030#comment-15883030
]
Goldstein Lyor commented on SSHD-728:
-------------------------------------
This seems like a different interpretation of the [SFTP protocol - draft
02|https://filezilla-project.org/specs/draft-ietf-secsh-filexfer-02.txt] - see
also [this WINSCP similar
issue|http://www.chiark.greenend.org.uk/~sgtatham/putty/wishlist/fxp-short-reads.html]:
{quote}
In response to this request, the server will read as many bytes as it can from
the file (up to `len'), and return them in a SSH_FXP_DATA message. If an
error occurs or EOF is encountered before reading any data, the server will
respond with SSH_FXP_STATUS. For normal disk files, it is guaranteed that this
will read the specified number of bytes, or up to end of file. For e.g.
device files this may return fewer bytes than requested.
{quote}
However, in later drafts (e.g., [draft
09|https://tools.ietf.org/html/draft-ietf-secsh-filexfer-09]) this is clarified
as follows:
{quote}
The server MUST not respond with more data than is specified by the 'length'
parameter. However, the server MAY respond with less data if EOF is reached,
an error is encountered, or the servers internal buffers can not handle such a
large request.
{quote}
The only exception to this rule is
{quote}
If the server specified a non-zero 'max-read-size' in its 'supported2' (Section
5.4) extension and 'length' is <= 'max-read- size', then failure to return
'length' bytes indicates that EOF or an error occurred.
{quote}
The SSHD code is exempt from this rule since it always indicates a zero value
for {{max-read-size}}. That being said, I will try and see why the short buffer
seems to occur before EOF and see if we can do something about it.
> sshd-core sftp not working with FileZilla sftp client
> -----------------------------------------------------
>
> Key: SSHD-728
> URL: https://issues.apache.org/jira/browse/SSHD-728
> Project: MINA SSHD
> Issue Type: Bug
> Affects Versions: 1.3.0
> Reporter: tntim96
> Assignee: Goldstein Lyor
>
> I've upgraded from sshd-core 0.14.0 to 1.3.0. FileZilla file download for
> largish files worked on 0.14.0 but not 1.3.0.
> Steps to reproduce:
> # Set up a server with the code below
> # Make sure there is a largish file to download (I tested with size 1048576)
> # Connect to the server with FileZilla (I tried version 3.9.0.5)
> # Try to download the file
> # The error {noformat}Error: error while reading: received a short buffer
> from FXP_READ, but not at EOF
> Error: File transfer failed after transferring 16384 bytes in 1
> second{noformat} appears in the FileZilla logs
> # Multiple FileZilla popups to overwrite the file appear (obviously connected
> to the error above)
> # The download fails
> {code:title=Simple configuration to generate error}
> SshServer sshd = SshServer.setUpDefaultServer();
> sshd.setKeyPairProvider(new SimpleGeneratorHostKeyProvider());
> sshd.setPort(2222);
> sshd.setShellFactory(InteractiveProcessShellFactory.INSTANCE);
> sshd.setPasswordAuthenticator((username, password, session) ->
> Objects.equals(username, password));
> sshd.setPublickeyAuthenticator(AcceptAllPublickeyAuthenticator.INSTANCE);
> sshd.setTcpipForwardingFilter(AcceptAllForwardingFilter.INSTANCE);
> sshd.setCommandFactory(new ScpCommandFactory.Builder().withDelegate(
> command -> new ProcessShellFactory(GenericUtils.split(command, '
> ')).create()
> ).build());
> sshd.setSubsystemFactories(Collections.singletonList(new
> SftpSubsystemFactory()));
> sshd.start();
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)