mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-17 13:19:52 +01:00
Unregister connection if sending stream header fails.
This commit is contained in:
@@ -553,21 +553,14 @@ class ConnectionManagerImpl implements ConnectionManager {
|
|||||||
onError(true);
|
onError(true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// Flush the output stream to send the outgoing stream header
|
|
||||||
StreamWriter out;
|
|
||||||
try {
|
|
||||||
out = streamWriterFactory.createStreamWriter(
|
|
||||||
writer.getOutputStream(), ctxOut);
|
|
||||||
out.getOutputStream().flush();
|
|
||||||
} catch (IOException e) {
|
|
||||||
logException(LOG, WARNING, e);
|
|
||||||
onError(true);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
// Handshake and exchange contacts
|
// Handshake and exchange contacts
|
||||||
try {
|
try {
|
||||||
InputStream in = streamReaderFactory.createStreamReader(
|
InputStream in = streamReaderFactory.createStreamReader(
|
||||||
reader.getInputStream(), ctxIn);
|
reader.getInputStream(), ctxIn);
|
||||||
|
// Flush the output stream to send the outgoing stream header
|
||||||
|
StreamWriter out = streamWriterFactory.createStreamWriter(
|
||||||
|
writer.getOutputStream(), ctxOut);
|
||||||
|
out.getOutputStream().flush();
|
||||||
HandshakeResult result = handshakeManager.handshake(
|
HandshakeResult result = handshakeManager.handshake(
|
||||||
pendingContactId, in, out);
|
pendingContactId, in, out);
|
||||||
Contact contact = contactExchangeManager.exchangeContacts(
|
Contact contact = contactExchangeManager.exchangeContacts(
|
||||||
@@ -671,7 +664,7 @@ class ConnectionManagerImpl implements ConnectionManager {
|
|||||||
onError();
|
onError();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// Create and run the handshake session
|
// Handshake and exchange contacts
|
||||||
try {
|
try {
|
||||||
InputStream in = streamReaderFactory.createStreamReader(
|
InputStream in = streamReaderFactory.createStreamReader(
|
||||||
reader.getInputStream(), ctxIn);
|
reader.getInputStream(), ctxIn);
|
||||||
|
|||||||
Reference in New Issue
Block a user