mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-20 14:49:53 +01:00
Merge branch '2261-extra-logging' into 'master'
Add logging for message delivery, comments for initial messages exchanged in tests See merge request briar/briar!1641
This commit is contained in:
@@ -233,6 +233,9 @@ class ValidationManagerImpl implements ValidationManager, Service,
|
|||||||
if (v == null) {
|
if (v == null) {
|
||||||
if (LOG.isLoggable(WARNING)) LOG.warning("No validator for " + cv);
|
if (LOG.isLoggable(WARNING)) LOG.warning("No validator for " + cv);
|
||||||
} else {
|
} else {
|
||||||
|
if (LOG.isLoggable(INFO)) {
|
||||||
|
LOG.info("Validating message for " + cv.getClientId());
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
MessageContext context = v.validateMessage(m, g);
|
MessageContext context = v.validateMessage(m, g);
|
||||||
storeMessageContextAsync(m, g.getClientId(),
|
storeMessageContextAsync(m, g.getClientId(),
|
||||||
@@ -323,6 +326,9 @@ class ValidationManagerImpl implements ValidationManager, Service,
|
|||||||
ClientMajorVersion cv = new ClientMajorVersion(c, majorVersion);
|
ClientMajorVersion cv = new ClientMajorVersion(c, majorVersion);
|
||||||
IncomingMessageHook hook = hooks.get(cv);
|
IncomingMessageHook hook = hooks.get(cv);
|
||||||
if (hook == null) return ACCEPT_DO_NOT_SHARE;
|
if (hook == null) return ACCEPT_DO_NOT_SHARE;
|
||||||
|
if (LOG.isLoggable(INFO)) {
|
||||||
|
LOG.info("Delivering message for " + c);
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
return hook.incomingMessage(txn, m, meta);
|
return hook.incomingMessage(txn, m, meta);
|
||||||
} catch (DbException e) {
|
} catch (DbException e) {
|
||||||
|
|||||||
@@ -345,11 +345,16 @@ public class TransportKeyAgreementIntegrationTest
|
|||||||
.canSendOutgoingStreams(aliceId, DUPLEX_TRANSPORT_ID));
|
.canSendOutgoingStreams(aliceId, DUPLEX_TRANSPORT_ID));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Sync initial client versioning updates and mailbox updates
|
// Sync client versioning update from Alice to Bob
|
||||||
syncMessage(alice, bob, bobId, 1, true);
|
syncMessage(alice, bob, bobId, 1, true);
|
||||||
|
// Sync client versioning update and ack from Bob to Alice
|
||||||
syncMessage(bob, alice, aliceId, 1, true);
|
syncMessage(bob, alice, aliceId, 1, true);
|
||||||
|
// Sync second client versioning update, mailbox properties and ack
|
||||||
|
// from Alice to Bob
|
||||||
syncMessage(alice, bob, bobId, 2, true);
|
syncMessage(alice, bob, bobId, 2, true);
|
||||||
|
// Sync mailbox properties and ack from Bob to Alice
|
||||||
syncMessage(bob, alice, aliceId, 1, true);
|
syncMessage(bob, alice, aliceId, 1, true);
|
||||||
|
// Sync final ack from Alice to Bob
|
||||||
sendAcks(alice, bob, bobId, 1);
|
sendAcks(alice, bob, bobId, 1);
|
||||||
|
|
||||||
return new Pair<>(aliceId, bobId);
|
return new Pair<>(aliceId, bobId);
|
||||||
|
|||||||
@@ -1057,6 +1057,7 @@ public class IntroductionIntegrationTest
|
|||||||
sync1To0(1, true);
|
sync1To0(1, true);
|
||||||
sync0To1(3, true);
|
sync0To1(3, true);
|
||||||
sync1To0(2, true);
|
sync1To0(2, true);
|
||||||
|
ack0To1(2);
|
||||||
|
|
||||||
// a new introduction should be possible
|
// a new introduction should be possible
|
||||||
assertTrue(introductionManager0
|
assertTrue(introductionManager0
|
||||||
|
|||||||
@@ -172,17 +172,28 @@ public abstract class BriarIntegrationTest<C extends BriarIntegrationTestCompone
|
|||||||
true);
|
true);
|
||||||
contact0From2 = contactManager2.getContact(contactId0From2);
|
contact0From2 = contactManager2.getContact(contactId0From2);
|
||||||
|
|
||||||
// Sync initial client versioning updates and mailbox updates
|
// Sync client versioning update from 0 to 1
|
||||||
sync0To1(1, true);
|
sync0To1(1, true);
|
||||||
|
// Sync client versioning update and ack from 1 to 0
|
||||||
sync1To0(1, true);
|
sync1To0(1, true);
|
||||||
|
// Sync second client versioning update, mailbox properties and ack
|
||||||
|
// from 0 to 1
|
||||||
sync0To1(2, true);
|
sync0To1(2, true);
|
||||||
|
// Sync mailbox properties and ack from 1 to 0
|
||||||
sync1To0(1, true);
|
sync1To0(1, true);
|
||||||
|
// Sync final ack from 0 to 1
|
||||||
ack0To1(1);
|
ack0To1(1);
|
||||||
|
|
||||||
|
// Sync client versioning update from 0 to 2
|
||||||
sync0To2(1, true);
|
sync0To2(1, true);
|
||||||
|
// Sync client versioning update and ack from 2 to 0
|
||||||
sync2To0(1, true);
|
sync2To0(1, true);
|
||||||
|
// Sync second client versioning update, mailbox properties and ack
|
||||||
|
// from 0 to 2
|
||||||
sync0To2(2, true);
|
sync0To2(2, true);
|
||||||
|
// Sync mailbox properties and ack from 2 to 0
|
||||||
sync2To0(1, true);
|
sync2To0(1, true);
|
||||||
|
// Sync final ack from 0 to 2
|
||||||
ack0To2(1);
|
ack0To2(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -199,18 +210,26 @@ public abstract class BriarIntegrationTest<C extends BriarIntegrationTestCompone
|
|||||||
rootKey1_2, c2.getClock().currentTimeMillis(), false, true,
|
rootKey1_2, c2.getClock().currentTimeMillis(), false, true,
|
||||||
true);
|
true);
|
||||||
|
|
||||||
// Sync initial client versioning updates
|
// Sync initial client versioning update from 1 to 2
|
||||||
sync1To2(1, true);
|
sync1To2(1, true);
|
||||||
|
// Sync initial client versioning update and ack from 2 to 1
|
||||||
sync2To1(1, true);
|
sync2To1(1, true);
|
||||||
// Sync 2nd client versioning msg from 1to2, mailbox updates, and
|
|
||||||
// transport properties if we should
|
|
||||||
if (haveTransportProperties) {
|
if (haveTransportProperties) {
|
||||||
|
// Sync second client versioning update, mailbox properties,
|
||||||
|
// transport properties and ack from 1 to 2
|
||||||
sync1To2(3, true);
|
sync1To2(3, true);
|
||||||
|
// Sync mailbox properties, transport properties and acks
|
||||||
|
// from 2 to 1
|
||||||
sync2To1(2, true);
|
sync2To1(2, true);
|
||||||
|
// Sync final acks from 1 to 2
|
||||||
ack1To2(2);
|
ack1To2(2);
|
||||||
} else {
|
} else {
|
||||||
|
// Sync second client versioning update, mailbox properties
|
||||||
|
// and ack from 1 to 2
|
||||||
sync1To2(2, true);
|
sync1To2(2, true);
|
||||||
|
// Sync mailbox properties and acks from 2 to 1
|
||||||
sync2To1(1, true);
|
sync2To1(1, true);
|
||||||
|
// Sync final ack from 1 to 2
|
||||||
ack1To2(1);
|
ack1To2(1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user