[jira] [Commented] (SSHD-936) Track SFTP put successful completion

2019-08-01 Thread Goldstein Lyor (JIRA)


[ 
https://issues.apache.org/jira/browse/SSHD-936?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16898166#comment-16898166
 ] 

Goldstein Lyor commented on SSHD-936:
-

There is no such operation called "put" in the SFTP protocol - what the command 
does is OPEN + n * WRITE + CLOSE - all of them reflected by the 
{{SftpEventListener}}. Furthermore, surprisingly, there is such thing as a 
"successful" or "aborted" state of  a file transfer. There is no indication to 
the server how many bytes the client intends to write so there is no way to 
"track" the upload. The client might decide to close the transfer after having 
written only part of  the file due to some client-side reasons - the server 
will simply see the same OPEN+WRITE+CLOSE sequence as if the full file was 
transferred (less WRITE(s) of course). Furthermore, there is no "close reason 
code" to tell the server that this transfer has been aborted. Furthermore, the 
client might decide to send *more* than the actual file size (by re-sending the 
same block of data several times) and even send the data "out-of-sequence" - 
i.e., write block 100 before block 99.

I believe I have seen this request in the past and pretty much gave the same 
answer - if you want an all-or-nothing indication then SCP and SFTP is the way 
- in SCP the client tells the server how many bytes are going to be uploaded, 
and the server makes sure that *exact* number of bytes is sent. You can use an 
{{ScpTransferEventListener}} to monitor such transfers.

> Track SFTP put successful completion
> 
>
> Key: SSHD-936
> URL: https://issues.apache.org/jira/browse/SSHD-936
> Project: MINA SSHD
>  Issue Type: Wish
>Affects Versions: 2.1.0
>Reporter: Logan
>Priority: Major
>
> While we can track sftp events with SftpEventListener, there is no event/hook 
> to indicate the sftp put is completed successfully. "Successfully" here means 
> file transfer was done without being terminated/aborted for various reasons 
> (user intentional termination, broken connection because of network 
> error). I think this was tried in earlier versions through 
> [FileUploadAware|[https://github.com/apache/mina-sshd/pull/11/files]]. Is 
> this something possible or just a limitation of protocol?
>  
> FYI - close method of SftpEventListener is called for successfully transfers 
> as well as aborted connections.



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)

-
To unsubscribe, e-mail: dev-unsubscr...@mina.apache.org
For additional commands, e-mail: dev-h...@mina.apache.org



[jira] [Commented] (SSHD-936) Track SFTP put successful completion

2019-08-01 Thread Logan (JIRA)


[ 
https://issues.apache.org/jira/browse/SSHD-936?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16898185#comment-16898185
 ] 

Logan commented on SSHD-936:


?? believe I have seen this request in the past and pretty much gave the same 
answer - if you want an all-or-nothing indication then SCP and SFTP is the 
way??. SFTP there was intentional?

Also recall reading SCP is outdated and sftp is recommended away.

> Track SFTP put successful completion
> 
>
> Key: SSHD-936
> URL: https://issues.apache.org/jira/browse/SSHD-936
> Project: MINA SSHD
>  Issue Type: Wish
>Affects Versions: 2.1.0
>Reporter: Logan
>Priority: Major
>
> While we can track sftp events with SftpEventListener, there is no event/hook 
> to indicate the sftp put is completed successfully. "Successfully" here means 
> file transfer was done without being terminated/aborted for various reasons 
> (user intentional termination, broken connection because of network 
> error). I think this was tried in earlier versions through 
> [FileUploadAware|https://github.com/apache/mina-sshd/pull/11/files]. Is this 
> something possible or just a limitation of protocol?
>  
> FYI - close method of SftpEventListener is called for successfully transfers 
> as well as aborted connections.



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)

-
To unsubscribe, e-mail: dev-unsubscr...@mina.apache.org
For additional commands, e-mail: dev-h...@mina.apache.org



[jira] [Commented] (SSHD-936) Track SFTP put successful completion

2019-08-01 Thread Logan (JIRA)


[ 
https://issues.apache.org/jira/browse/SSHD-936?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16898298#comment-16898298
 ] 

Logan commented on SSHD-936:


I added ScpCommandFactory and {{ScpTransferEventListener}}  to sshd along with 
SftpSubsystemFactory and I noticed nothing is getting called in 
{{ScpTransferEventListener}}  when I use scp command. Is this expected? However 
all events are SftpEventListener are called for scp and sftp. Attached is the 
sample code.

[^sshd-sftp-scp.txt]

> Track SFTP put successful completion
> 
>
> Key: SSHD-936
> URL: https://issues.apache.org/jira/browse/SSHD-936
> Project: MINA SSHD
>  Issue Type: Wish
>Affects Versions: 2.1.0
>Reporter: Logan
>Priority: Major
> Attachments: sshd-sftp-scp.txt
>
>
> While we can track sftp events with SftpEventListener, there is no event/hook 
> to indicate the sftp put is completed successfully. "Successfully" here means 
> file transfer was done without being terminated/aborted for various reasons 
> (user intentional termination, broken connection because of network 
> error). I think this was tried in earlier versions through 
> [FileUploadAware|https://github.com/apache/mina-sshd/pull/11/files]. Is this 
> something possible or just a limitation of protocol?
>  
> FYI - close method of SftpEventListener is called for successfully transfers 
> as well as aborted connections.



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)

-
To unsubscribe, e-mail: dev-unsubscr...@mina.apache.org
For additional commands, e-mail: dev-h...@mina.apache.org



[jira] [Commented] (SSHD-936) Track SFTP put successful completion

2019-08-02 Thread Goldstein Lyor (JIRA)


[ 
https://issues.apache.org/jira/browse/SSHD-936?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16898973#comment-16898973
 ] 

Goldstein Lyor commented on SSHD-936:
-

{quote}
  If I remove sftp then events flow to ScpTransferEventListener .Is this 
expected?
{quote}
No, and quite impossible under the standard SSH standards.I believe the 
*client* you are using may be "smart" and attempting to use SFTP, and failing 
that use SCP as a fallback. If you control the client then make sure it does 
not attempt to use SFTP. If you do not, then I don't see what you can do - 
other than avoid starting the SFTP on the server side - but then you are 
relying on some empirical knowledge of your client's behavior rather than on a 
standard protocol.

> Track SFTP put successful completion
> 
>
> Key: SSHD-936
> URL: https://issues.apache.org/jira/browse/SSHD-936
> Project: MINA SSHD
>  Issue Type: Wish
>Affects Versions: 2.1.0
>Reporter: Logan
>Priority: Major
> Attachments: sshd-sftp-scp.txt
>
>
> While we can track sftp events with SftpEventListener, there is no event/hook 
> to indicate the sftp put is completed successfully. "Successfully" here means 
> file transfer was done without being terminated/aborted for various reasons 
> (user intentional termination, broken connection because of network 
> error). I think this was tried in earlier versions through 
> [FileUploadAware|https://github.com/apache/mina-sshd/pull/11/files]. Is this 
> something possible or just a limitation of protocol?
>  
> FYI - close method of SftpEventListener is called for successfully transfers 
> as well as aborted connections.



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)

-
To unsubscribe, e-mail: dev-unsubscr...@mina.apache.org
For additional commands, e-mail: dev-h...@mina.apache.org