mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-18 05:39:53 +01:00
Additional logging in In/out DuplexSyncConnection
This commit is contained in:
@@ -50,6 +50,7 @@ class IncomingDuplexSyncConnection extends DuplexSyncConnection
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
|
LOG.info("Running IncomingDuplexSyncConnection");
|
||||||
// Read and recognise the tag
|
// Read and recognise the tag
|
||||||
StreamContext ctx = recogniseTag(reader, transportId);
|
StreamContext ctx = recogniseTag(reader, transportId);
|
||||||
if (ctx == null) {
|
if (ctx == null) {
|
||||||
@@ -127,6 +128,7 @@ class IncomingDuplexSyncConnection extends DuplexSyncConnection
|
|||||||
}
|
}
|
||||||
|
|
||||||
private boolean performHandshake(StreamContext ctxIn, ContactId contactId) {
|
private boolean performHandshake(StreamContext ctxIn, ContactId contactId) {
|
||||||
|
LOG.info("Performing handshake (Incoming)");
|
||||||
// Allocate the outgoing stream context
|
// Allocate the outgoing stream context
|
||||||
StreamContext ctxOut =
|
StreamContext ctxOut =
|
||||||
allocateStreamContext(contactId, transportId);
|
allocateStreamContext(contactId, transportId);
|
||||||
@@ -146,6 +148,7 @@ class IncomingDuplexSyncConnection extends DuplexSyncConnection
|
|||||||
handshakeManager.handshake(contactId, in, out);
|
handshakeManager.handshake(contactId, in, out);
|
||||||
keyManager.addRotationKeys(contactId, result.getMasterKey(),
|
keyManager.addRotationKeys(contactId, result.getMasterKey(),
|
||||||
TIMESTAMP, result.isAlice(), true);
|
TIMESTAMP, result.isAlice(), true);
|
||||||
|
LOG.info("Rotation keys added");
|
||||||
return true;
|
return true;
|
||||||
} catch (IOException | DbException e) {
|
} catch (IOException | DbException e) {
|
||||||
logException(LOG, WARNING, e);
|
logException(LOG, WARNING, e);
|
||||||
|
|||||||
@@ -61,6 +61,7 @@ class OutgoingDuplexSyncConnection extends DuplexSyncConnection
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
|
LOG.info("Running OutgoingDuplexSyncConnection");
|
||||||
// Allocate a stream context
|
// Allocate a stream context
|
||||||
StreamContext ctx = allocateStreamContext(contactId, transportId);
|
StreamContext ctx = allocateStreamContext(contactId, transportId);
|
||||||
if (ctx == null) {
|
if (ctx == null) {
|
||||||
@@ -153,6 +154,7 @@ class OutgoingDuplexSyncConnection extends DuplexSyncConnection
|
|||||||
}
|
}
|
||||||
|
|
||||||
private boolean performHandshake(StreamContext ctxOut) {
|
private boolean performHandshake(StreamContext ctxOut) {
|
||||||
|
LOG.info("Performing handshake (Outgoing)");
|
||||||
// Flush the output stream to send the outgoing stream header
|
// Flush the output stream to send the outgoing stream header
|
||||||
StreamWriter out;
|
StreamWriter out;
|
||||||
try {
|
try {
|
||||||
@@ -193,6 +195,7 @@ class OutgoingDuplexSyncConnection extends DuplexSyncConnection
|
|||||||
handshakeManager.handshake(contactId, in, out);
|
handshakeManager.handshake(contactId, in, out);
|
||||||
keyManager.addRotationKeys(contactId, result.getMasterKey(),
|
keyManager.addRotationKeys(contactId, result.getMasterKey(),
|
||||||
TIMESTAMP, result.isAlice(), true);
|
TIMESTAMP, result.isAlice(), true);
|
||||||
|
LOG.info("Rotation keys added");
|
||||||
return true;
|
return true;
|
||||||
} catch (IOException | DbException e) {
|
} catch (IOException | DbException e) {
|
||||||
logException(LOG, WARNING, e);
|
logException(LOG, WARNING, e);
|
||||||
|
|||||||
Reference in New Issue
Block a user