Main-Tomi opened a new pull request, #634:
URL: https://github.com/apache/mina-sshd/pull/634

   For the method of **writeDirEntry**, the method '**getLongName(f, shortName, 
options);**' call '**resolveFileAttributes**' to get attrs too. Using the attrs 
obtained earlier as parameters can reduce the time by half
   ```
   protected void writeDirEntry(
               int id, DirectoryHandle dir, Map<String, Path> entries, Buffer 
buffer,
               int index, Path f, String shortName, LinkOption... options)
               throws IOException {
           boolean followLinks = 
resolvePathResolutionFollowLinks(SftpConstants.SSH_FXP_READDIR, "", f);
           Map<String, ?> attrs = resolveFileAttributes(
                   f, SftpConstants.SSH_FILEXFER_ATTR_ALL, !followLinks, 
options);
           entries.put(shortName, f);
   
           SftpFileSystemAccessor accessor = getFileSystemAccessor();
           ServerSession session = getServerSession();
           accessor.putRemoteFileName(this, f, buffer, shortName, true);
   
           int version = getVersion();
           if (version == SftpConstants.SFTP_V3) {
               String longName = getLongName(f, shortName, options);
               accessor.putRemoteFileName(this, f, buffer, longName, false);
   
               if (log.isTraceEnabled()) {
                   log.trace("writeDirEntry({} id={})[{}] - {} [{}]: {}", 
session, id, index, shortName, longName, attrs);
               }
           } else {
               if (log.isTraceEnabled()) {
                   log.trace("writeDirEntry({} id={})[{}] - {}: {}", session, 
id, index, shortName, attrs);
               }
           }
   
           writeAttrs(buffer, attrs);
       }
   ```


-- 
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.

To unsubscribe, e-mail: dev-unsubscr...@mina.apache.org

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