Do not close m_socket in socketError()
ClosedPublic

Authored by eduisters on Dec 16 2018, 4:40 PM.

Details

Summary

When android closes the payload socket (cancel share) calling m_socket.close() results
in a recursive call to onError eventually leading to a segmentation violation

Test Plan

Install D16491, share a large file from desktop to android and cancel the share on Android through
the notification. kdeconnectd crashes almost 100% of the time. (It doesn't crash when it detects
a disconnect in sendNextPacket)

Diff Detail

Repository
R224 KDE Connect
Branch
crash_while_uploading_and_remote_closes_socket
Lint
Lint OK
Unit
No Unit Test Coverage
Build Status
Buildable 6079
Build 6097: arc lint + arc unit
eduisters created this revision.Dec 16 2018, 4:40 PM
Restricted Application added a project: KDE Connect. · View Herald TranscriptDec 16 2018, 4:40 PM
Restricted Application added a subscriber: kdeconnect. · View Herald Transcript
eduisters requested review of this revision.Dec 16 2018, 4:40 PM
eduisters edited the test plan for this revision. (Show Details)Dec 16 2018, 4:44 PM
eduisters added a reviewer: KDE Connect.
nicolasfella accepted this revision.Jan 5 2019, 7:04 PM
This revision is now accepted and ready to land.Jan 5 2019, 7:04 PM
This revision was automatically updated to reflect the committed changes.