Use new method to get stream context in handshake mode on incoming duplex sync connection

This commit is contained in:
ameba23
2021-08-27 09:58:08 +02:00
parent f1f16f8474
commit 2a45fd3c91

View File

@@ -130,13 +130,17 @@ class IncomingDuplexSyncConnection extends DuplexSyncConnection
private boolean performHandshake(StreamContext ctxIn, ContactId contactId) {
LOG.info("Performing handshake (Incoming)");
// Allocate the outgoing stream context
StreamContext ctxOut =
allocateStreamContext(contactId, transportId);
if (ctxOut == null) {
StreamContext ctxOut;
try {
ctxOut = keyManager.getStreamContextInHandshakeMode(contactId, transportId);
} catch (DbException e) {
logException(LOG, WARNING, e);
LOG.warning("Could not allocate stream context");
onReadError(true);
return false;
}
try {
InputStream in = streamReaderFactory.createStreamReader(
reader.getInputStream(), ctxIn);