Additional logging in In/out DuplexSyncConnection

This commit is contained in:
ameba23
2021-04-27 13:06:55 +02:00
parent 7ecd952f49
commit 68f135adad
2 changed files with 6 additions and 0 deletions

View File

@@ -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);

View File

@@ -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);