gnodet commented on a change in pull request #123:
URL: https://github.com/apache/mina-sshd/pull/123#discussion_r411682132



##########
File path: 
sshd-sftp/src/main/java/org/apache/sshd/client/subsystem/sftp/impl/AbstractSftpClient.java
##########
@@ -783,10 +786,6 @@ public void rename(String oldPath, String newPath, 
Collection<CopyMode> options)
     @Override
     public int read(Handle handle, long fileOffset, byte[] dst, int dstOffset, 
int len, AtomicReference<Boolean> eofSignalled)
             throws IOException {
-        if (eofSignalled != null) {
-            eofSignalled.set(null);
-        }
-

Review comment:
       We have `read` which calls `checkData` which calls `checkDataResponse`.  
Having the 3 methods setting `eofSignalled` to null when entering while the 
only place where it can be set to a non null value is later inside the 
`checkDataResponse` seems a bit redundant to me.  Also, I think checking the 
EOF value in case an exception has been thrown is meaningless, so only keeping 
the `eofSignalled.set(null)` from inside `checkDataResponse` sounds enough to 
me.

##########
File path: 
sshd-sftp/src/main/java/org/apache/sshd/client/subsystem/sftp/impl/AbstractSftpClient.java
##########
@@ -802,9 +801,6 @@ public int read(Handle handle, long fileOffset, byte[] dst, 
int dstOffset, int l
     protected int checkData(
             int cmd, Buffer request, int dstOffset, byte[] dst, 
AtomicReference<Boolean> eofSignalled)
             throws IOException {
-        if (eofSignalled != null) {
-            eofSignalled.set(null);
-        }

Review comment:
       See above




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



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

Reply via email to