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) { private boolean performHandshake(StreamContext ctxIn, ContactId contactId) {
LOG.info("Performing handshake (Incoming)"); LOG.info("Performing handshake (Incoming)");
// Allocate the outgoing stream context // Allocate the outgoing stream context
StreamContext ctxOut = StreamContext ctxOut;
allocateStreamContext(contactId, transportId);
if (ctxOut == null) { try {
ctxOut = keyManager.getStreamContextInHandshakeMode(contactId, transportId);
} catch (DbException e) {
logException(LOG, WARNING, e);
LOG.warning("Could not allocate stream context"); LOG.warning("Could not allocate stream context");
onReadError(true); onReadError(true);
return false; return false;
} }
try { try {
InputStream in = streamReaderFactory.createStreamReader( InputStream in = streamReaderFactory.createStreamReader(
reader.getInputStream(), ctxIn); reader.getInputStream(), ctxIn);