2
0
mirror of https://github.com/KDE/kdeconnect-android synced 2025-08-30 13:47:41 +00:00

Align NetworkPacket.hasPayload with desktop

Summary:
On desktop NetworkPacket.hasPayload() tests m_payloadSize
On android NetworkPacket.hasPayload() tests mPayload

This patch makes android also test mPayloadSize to make things more consistent

Reviewers: #kde_connect, albertvaka

Reviewed By: #kde_connect, albertvaka

Subscribers: kdeconnect

Tags: #kde_connect

Differential Revision: https://phabricator.kde.org/D17236
This commit is contained in:
Erik Duisters
2018-11-29 16:33:13 +01:00
parent 9b426fe4a5
commit 4dd651b386
2 changed files with 2 additions and 3 deletions

View File

@@ -150,7 +150,7 @@ public class LanLink extends BaseLink {
//Prepare socket for the payload
final ServerSocket server;
if (np.hasPayload() && np.getPayloadSize() != 0) {
if (np.hasPayload()) {
server = LanLinkProvider.openServerSocketOnFreePort(LanLinkProvider.PAYLOAD_TRANSFER_MIN_PORT);
JSONObject payloadTransferInfo = new JSONObject();
payloadTransferInfo.put("port", server.getLocalPort());
@@ -263,7 +263,6 @@ public class LanLink extends BaseLink {
}
if (np.hasPayloadTransferInfo()) {
Socket payloadSocket = new Socket();
try {
int tcpPort = np.getPayloadTransferInfo().getInt("port");

View File

@@ -309,7 +309,7 @@ public class NetworkPacket {
}
public boolean hasPayload() {
return (mPayload != null);
return (mPayloadSize != 0);
}
public boolean hasPayloadTransferInfo() {