mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-20 14:49:53 +01:00
Also store properties discovered from outgoing connections.
This is useful when adding a Bluetooth address is discovered while adding a contact.
This commit is contained in:
@@ -385,6 +385,7 @@ class ConnectionManagerImpl implements ConnectionManager {
|
|||||||
private final TransportId transportId;
|
private final TransportId transportId;
|
||||||
private final TransportConnectionReader reader;
|
private final TransportConnectionReader reader;
|
||||||
private final TransportConnectionWriter writer;
|
private final TransportConnectionWriter writer;
|
||||||
|
private final TransportProperties remote;
|
||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
private volatile SyncSession outgoingSession = null;
|
private volatile SyncSession outgoingSession = null;
|
||||||
@@ -395,6 +396,7 @@ class ConnectionManagerImpl implements ConnectionManager {
|
|||||||
this.transportId = transportId;
|
this.transportId = transportId;
|
||||||
reader = connection.getReader();
|
reader = connection.getReader();
|
||||||
writer = connection.getWriter();
|
writer = connection.getWriter();
|
||||||
|
remote = connection.getRemoteProperties();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -471,13 +473,16 @@ class ConnectionManagerImpl implements ConnectionManager {
|
|||||||
connectionRegistry.registerConnection(contactId, transportId,
|
connectionRegistry.registerConnection(contactId, transportId,
|
||||||
false);
|
false);
|
||||||
try {
|
try {
|
||||||
|
// Store any transport properties discovered from the connection
|
||||||
|
transportPropertyManager.addRemotePropertiesFromConnection(
|
||||||
|
contactId, transportId, remote);
|
||||||
// Create and run the incoming session
|
// Create and run the incoming session
|
||||||
createIncomingSession(ctx, reader).run();
|
createIncomingSession(ctx, reader).run();
|
||||||
reader.dispose(false, true);
|
reader.dispose(false, true);
|
||||||
// Interrupt the outgoing session so it finishes cleanly
|
// Interrupt the outgoing session so it finishes cleanly
|
||||||
SyncSession out = outgoingSession;
|
SyncSession out = outgoingSession;
|
||||||
if (out != null) out.interrupt();
|
if (out != null) out.interrupt();
|
||||||
} catch (IOException e) {
|
} catch (DbException | IOException e) {
|
||||||
logException(LOG, WARNING, e);
|
logException(LOG, WARNING, e);
|
||||||
onReadError();
|
onReadError();
|
||||||
} finally {
|
} finally {
|
||||||
|
|||||||
Reference in New Issue
Block a user