From 68f135adada753a4bcf703e87405d1ccf5c830fd Mon Sep 17 00:00:00 2001 From: ameba23 Date: Tue, 27 Apr 2021 13:06:55 +0200 Subject: [PATCH] Additional logging in In/out DuplexSyncConnection --- .../bramble/connection/IncomingDuplexSyncConnection.java | 3 +++ .../bramble/connection/OutgoingDuplexSyncConnection.java | 3 +++ 2 files changed, 6 insertions(+) diff --git a/bramble-core/src/main/java/org/briarproject/bramble/connection/IncomingDuplexSyncConnection.java b/bramble-core/src/main/java/org/briarproject/bramble/connection/IncomingDuplexSyncConnection.java index 1ce4af531..6e9c53e18 100644 --- a/bramble-core/src/main/java/org/briarproject/bramble/connection/IncomingDuplexSyncConnection.java +++ b/bramble-core/src/main/java/org/briarproject/bramble/connection/IncomingDuplexSyncConnection.java @@ -50,6 +50,7 @@ class IncomingDuplexSyncConnection extends DuplexSyncConnection @Override public void run() { + LOG.info("Running IncomingDuplexSyncConnection"); // Read and recognise the tag StreamContext ctx = recogniseTag(reader, transportId); if (ctx == null) { @@ -127,6 +128,7 @@ class IncomingDuplexSyncConnection extends DuplexSyncConnection } private boolean performHandshake(StreamContext ctxIn, ContactId contactId) { + LOG.info("Performing handshake (Incoming)"); // Allocate the outgoing stream context StreamContext ctxOut = allocateStreamContext(contactId, transportId); @@ -146,6 +148,7 @@ class IncomingDuplexSyncConnection extends DuplexSyncConnection handshakeManager.handshake(contactId, in, out); keyManager.addRotationKeys(contactId, result.getMasterKey(), TIMESTAMP, result.isAlice(), true); + LOG.info("Rotation keys added"); return true; } catch (IOException | DbException e) { logException(LOG, WARNING, e); diff --git a/bramble-core/src/main/java/org/briarproject/bramble/connection/OutgoingDuplexSyncConnection.java b/bramble-core/src/main/java/org/briarproject/bramble/connection/OutgoingDuplexSyncConnection.java index 9ffb974c6..382e6e23f 100644 --- a/bramble-core/src/main/java/org/briarproject/bramble/connection/OutgoingDuplexSyncConnection.java +++ b/bramble-core/src/main/java/org/briarproject/bramble/connection/OutgoingDuplexSyncConnection.java @@ -61,6 +61,7 @@ class OutgoingDuplexSyncConnection extends DuplexSyncConnection @Override public void run() { + LOG.info("Running OutgoingDuplexSyncConnection"); // Allocate a stream context StreamContext ctx = allocateStreamContext(contactId, transportId); if (ctx == null) { @@ -153,6 +154,7 @@ class OutgoingDuplexSyncConnection extends DuplexSyncConnection } private boolean performHandshake(StreamContext ctxOut) { + LOG.info("Performing handshake (Outgoing)"); // Flush the output stream to send the outgoing stream header StreamWriter out; try { @@ -193,6 +195,7 @@ class OutgoingDuplexSyncConnection extends DuplexSyncConnection handshakeManager.handshake(contactId, in, out); keyManager.addRotationKeys(contactId, result.getMasterKey(), TIMESTAMP, result.isAlice(), true); + LOG.info("Rotation keys added"); return true; } catch (IOException | DbException e) { logException(LOG, WARNING, e);