D27872: sftp: fix partial transfer resuming when copying to local

Stefan BrĂ¼ns noreply at phabricator.kde.org
Fri Mar 6 19:05:53 GMT 2020


bruns requested changes to this revision.
bruns added inline comments.
This revision now requires changes to proceed.

INLINE COMMENTS

> kio_sftp.cpp:1935
>  
> -    if (bMarkPartial && bPartExists && copyFile.size() > 0) {
> +    if (bMarkPartial && bPartExists && partFile.size() > 0) {
>          if (partFile.isDir()) {

Dependent on the file system, this will no longer catch `partFile.isDir()`. stat.st_size is only defined for regular files and symlinks, for all other types it is implementation defined. E.g. XFS and Btrfs return 0 for empty directories.

> kio_sftp.cpp:1936
> +    if (bMarkPartial && bPartExists && partFile.size() > 0) {
>          if (partFile.isDir()) {
>              return Result::fail(ERR_FILE_ALREADY_EXIST, sCopyFile);

should be `if (!partFile.isFile())` - we cant resume a pipe or socket ...

REPOSITORY
  R320 KIO Extras

REVISION DETAIL
  https://phabricator.kde.org/D27872

To: sitter, ngraham, feverfew, bruns
Cc: bruns, kde-frameworks-devel, kfm-devel, pberestov, iasensio, fprice, LeGast00n, cblack, MrPepe, fbampaloukas, alexde, GB_2, Codezela, feverfew, meven, michaelh, spoorun, navarromorales, firef, ngraham, andrebarros, emmanuelp, mikesomov
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.kde.org/mailman/private/kfm-devel/attachments/20200306/012fbfe0/attachment.htm>


More information about the kfm-devel mailing list