D27871: sftp: fix seekPos + file resuming when part file is of size 11

2020-03-19 Thread Harald Sitter
This revision was automatically updated to reflect the committed changes. Closed by commit R320:d8cf85ec2f0f: sftp: fix seekPos + file resuming when part file is of size 11 (authored by sitter). REPOSITORY R320 KIO Extras CHANGES SINCE LAST UPDATE https://phabricator.kde.org/D27871?vs=77036&

D27871: sftp: fix seekPos + file resuming when part file is of size 11

2020-03-16 Thread Nathaniel Graham
ngraham accepted this revision. ngraham added a comment. This revision is now accepted and ready to land. Let's land this now as-is and make that change universally in a separate patch before we bikeshed it to death. :) REPOSITORY R320 KIO Extras BRANCH sftp-seekpos REVISION DETAIL ht

D27871: sftp: fix seekPos + file resuming when part file is of size 11

2020-03-10 Thread Harald Sitter
sitter added inline comments. INLINE COMMENTS > bruns wrote in kio_sftp.cpp:1687 > Essentially, apply the change from the man page example to the code here: > > if (pos != sbPart->size) { > int errsv = errno; > qCDebug(KIO_SFTP_LOG) << "Failed to seek to" << sbPart->size << "bytes

D27871: sftp: fix seekPos + file resuming when part file is of size 11

2020-03-09 Thread Stefan Brüns
bruns added inline comments. INLINE COMMENTS > sitter wrote in kio_sftp.cpp:1687 > Oh, I'm sorry. My reading comprehension isn't so good. I am not sure what you > are asking of me though. errno access in qdebug streaming is used all over > our software and this line here isn't even new. If the

D27871: sftp: fix seekPos + file resuming when part file is of size 11

2020-03-09 Thread Harald Sitter
sitter added inline comments. INLINE COMMENTS > bruns wrote in kio_sftp.cpp:1687 > Which part of > > > A common mistake is to do > > did you miss? Oh, I'm sorry. My reading comprehension isn't so good. I am not sure what you are asking of me though. errno access in qdebug streaming is used al

D27871: sftp: fix seekPos + file resuming when part file is of size 11

2020-03-09 Thread Stefan Brüns
bruns added inline comments. INLINE COMMENTS > sitter wrote in kio_sftp.cpp:1687 > We do that all over the place. Which part of > A common mistake is to do did you miss? REPOSITORY R320 KIO Extras REVISION DETAIL https://phabricator.kde.org/D27871 To: sitter, ngraham, feverfew Cc: bruns

D27871: sftp: fix seekPos + file resuming when part file is of size 11

2020-03-09 Thread Harald Sitter
sitter added a comment. In D27871#623593 , @bruns wrote: > In D27871#623542 , @sitter wrote: > > > In D27871#622933 , @bruns wrote: > > > > > Can you al

D27871: sftp: fix seekPos + file resuming when part file is of size 11

2020-03-06 Thread Stefan Brüns
bruns added a comment. In D27871#623542 , @sitter wrote: > In D27871#622933 , @bruns wrote: > > > Can you also mention why errno == EGAIN does not have to be handled ("EAGAIN could only happen iff th

D27871: sftp: fix seekPos + file resuming when part file is of size 11

2020-03-06 Thread Stefan Brüns
bruns added inline comments. INLINE COMMENTS > sitter wrote in kio_sftp.cpp:1687 > Which call between the seek and the debug do you take offense here exactly? qCDebug(), operator<< REPOSITORY R320 KIO Extras REVISION DETAIL https://phabricator.kde.org/D27871 To: sitter, ngraham, feverfew

D27871: sftp: fix seekPos + file resuming when part file is of size 11

2020-03-06 Thread Harald Sitter
sitter added inline comments. INLINE COMMENTS > bruns wrote in kio_sftp.cpp:1687 > You should save errno immediately after QT_LSEEK, otherwise any function may > overwrite it. See `man 3 errno`: > > > A common mistake is to do > > > > if (somecall() == -1) { > > printf("somecall() fail

D27871: sftp: fix seekPos + file resuming when part file is of size 11

2020-03-06 Thread Harald Sitter
sitter added a comment. In D27871#622933 , @bruns wrote: > Can you also mention why errno == EGAIN does not have to be handled ("EAGAIN could only happen iff the file where opened with O_NONBLOCK. All other seek errors are fatal."). I do

D27871: sftp: fix seekPos + file resuming when part file is of size 11

2020-03-05 Thread Stefan Brüns
bruns added a comment. Can you also mention why errno == EGAIN does not have to be handled ("EAGAIN could only happen iff the file where opened with O_NONBLOCK. All other seek errors are fatal."). REPOSITORY R320 KIO Extras REVISION DETAIL https://phabricator.kde.org/D27871 To: sitter,

D27871: sftp: fix seekPos + file resuming when part file is of size 11

2020-03-05 Thread Stefan Brüns
bruns added inline comments. INLINE COMMENTS > kio_sftp.cpp:1687 > if (pos != sbPart->size) { > -qCDebug(KIO_SFTP_LOG) << "Failed to seek to" << > sbPart->size << "bytes in source file. Reason given" << strerror(errno); > +qCDebug(KIO_SFTP

D27871: sftp: fix seekPos + file resuming when part file is of size 11

2020-03-05 Thread Harald Sitter
sitter created this revision. sitter added reviewers: ngraham, feverfew. Herald added projects: Dolphin, Frameworks. Herald added subscribers: kfm-devel, kde-frameworks-devel. sitter requested review of this revision. REVISION SUMMARY previously seekPos would loop over offset==EAGAIN. the return