D11649: Fix crash in the file slave

Albert Astals Cid noreply at phabricator.kde.org
Sat Mar 24 16:23:35 UTC 2018


aacid created this revision.
aacid added reviewers: Frameworks, dfaure.
Restricted Application added a project: Frameworks.
aacid requested review of this revision.

REVISION SUMMARY
  When doing a KIO::storedPut to a filename that has a .part file existing there were two problems:
  
  - We were never answering to the canResume signal, so it was crashing in waitForAnswer because we didn't get the proper answer
  - We were sending the data on start unconditionally, which means when the slave asked for canResume it had the wrong answer
  
  The line removed in start seems not to be needed anymore, tests pass without it and KDE Connect that is one of the main users of this still seems to work.
  
  I'm not totally sure it's the best of the ideas adding the handling of canResume to StoredTransferJob since users of it may already have implemented.
  
  To be honest I'm not totally sure this is the totally correct fix. Comments more than welcome.

TEST PLAN
  Without the code changes the newly added test makes the file ioslave crash

REPOSITORY
  R241 KIO

BRANCH
  master

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

AFFECTED FILES
  autotests/jobtest.cpp
  autotests/jobtest.h
  src/core/slavebase.cpp
  src/core/storedtransferjob.cpp
  src/core/transferjob.cpp

To: aacid, #frameworks, dfaure
Cc: michaelh, ngraham
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20180324/3f499c7d/attachment-0001.html>


More information about the Kde-frameworks-devel mailing list