Improve logging for DuplexSyncConnection

This commit is contained in:
ameba23
2021-06-29 16:09:08 +02:00
parent 4b9c3a1a96
commit 53c4ba184d
2 changed files with 8 additions and 7 deletions

View File

@@ -3,7 +3,6 @@ package org.briarproject.bramble.connection;
import org.briarproject.bramble.api.connection.ConnectionRegistry;
import org.briarproject.bramble.api.contact.ContactId;
import org.briarproject.bramble.api.contact.HandshakeManager;
import org.briarproject.bramble.api.contact.PendingContactId;
import org.briarproject.bramble.api.db.DbException;
import org.briarproject.bramble.api.nullsafety.NotNullByDefault;
import org.briarproject.bramble.api.plugin.TransportId;
@@ -50,7 +49,8 @@ class IncomingDuplexSyncConnection extends DuplexSyncConnection
@Override
public void run() {
LOG.info("Running IncomingDuplexSyncConnection");
LOG.info("Running IncomingDuplexSyncConnection on transport " +
transportId.getString());
// Read and recognise the tag
StreamContext ctx = recogniseTag(reader, transportId);
if (ctx == null) {
@@ -65,10 +65,10 @@ class IncomingDuplexSyncConnection extends DuplexSyncConnection
return;
}
if (ctx.isHandshakeMode()) {
if (!performHandshake(ctx, contactId)) {
LOG.warning("Handshake failed");
return;
}
if (!performHandshake(ctx, contactId)) {
LOG.warning("Handshake failed");
return;
}
// Allocate a rotation mode stream context
ctx = allocateStreamContext(contactId, transportId);
if (ctx == null) {

View File

@@ -61,7 +61,8 @@ class OutgoingDuplexSyncConnection extends DuplexSyncConnection
@Override
public void run() {
LOG.info("Running OutgoingDuplexSyncConnection");
LOG.info("Running OutgoingDuplexSyncConnection on transport " +
transportId.getString());
// Allocate a stream context
StreamContext ctx = allocateStreamContext(contactId, transportId);
if (ctx == null) {