2
0
mirror of https://github.com/KDE/kdeconnect-android synced 2025-08-31 14:15:14 +00:00

Allow sharing of empty files

Summary:
When an empty file is shared with the desktop a server is started that times-out after 10sec
this causes a notification to be displayed telling the user the transfer failed

Test Plan:
Send an empty file to the desktop
A notification should be displayed telling the user the transfer succeeded

Reviewers: #kde_connect, albertvaka

Reviewed By: #kde_connect, albertvaka

Subscribers: albertvaka, kdeconnect

Tags: #kde_connect

Differential Revision: https://phabricator.kde.org/D17176
This commit is contained in:
Erik Duisters
2018-11-26 18:00:34 +01:00
parent 58cd88b760
commit 5d50358f3f

View File

@@ -150,7 +150,7 @@ public class LanLink extends BaseLink {
//Prepare socket for the payload
final ServerSocket server;
if (np.hasPayload()) {
if (np.hasPayload() && np.getPayloadSize() != 0) {
server = LanLinkProvider.openServerSocketOnFreePort(LanLinkProvider.PAYLOAD_TRANSFER_MIN_PORT);
JSONObject payloadTransferInfo = new JSONObject();
payloadTransferInfo.put("port", server.getLocalPort());