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:
@@ -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");
|
||||
|
@@ -309,7 +309,7 @@ public class NetworkPacket {
|
||||
}
|
||||
|
||||
public boolean hasPayload() {
|
||||
return (mPayload != null);
|
||||
return (mPayloadSize != 0);
|
||||
}
|
||||
|
||||
public boolean hasPayloadTransferInfo() {
|
||||
|
Reference in New Issue
Block a user