From 0af42bda445715b896b73f67697ab6ff578e3e43 Mon Sep 17 00:00:00 2001 From: Matthew Nesbit Date: Wed, 4 Apr 2018 11:23:09 +0100 Subject: [PATCH] Fix a bug in the AMQP protocol wrapper code which gives incorrect reply address information on received packets. (#2914) --- .../internal/protonwrapper/engine/ConnectionStateMachine.kt | 4 ++-- .../internal/protonwrapper/netty/AMQPChannelHandler.kt | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/node-api/src/main/kotlin/net/corda/nodeapi/internal/protonwrapper/engine/ConnectionStateMachine.kt b/node-api/src/main/kotlin/net/corda/nodeapi/internal/protonwrapper/engine/ConnectionStateMachine.kt index 473c28876c..42575770e0 100644 --- a/node-api/src/main/kotlin/net/corda/nodeapi/internal/protonwrapper/engine/ConnectionStateMachine.kt +++ b/node-api/src/main/kotlin/net/corda/nodeapi/internal/protonwrapper/engine/ConnectionStateMachine.kt @@ -359,9 +359,9 @@ internal class ConnectionStateMachine(serverMode: Boolean, payload, link.source.address, remoteLegalName, - NetworkHostAndPort(localAddress.hostString, localAddress.port), - localLegalName, NetworkHostAndPort(remoteAddress.hostString, remoteAddress.port), + localLegalName, + NetworkHostAndPort(localAddress.hostString, localAddress.port), appProperties, channel, delivery) diff --git a/node-api/src/main/kotlin/net/corda/nodeapi/internal/protonwrapper/netty/AMQPChannelHandler.kt b/node-api/src/main/kotlin/net/corda/nodeapi/internal/protonwrapper/netty/AMQPChannelHandler.kt index 25855df558..06237626bb 100644 --- a/node-api/src/main/kotlin/net/corda/nodeapi/internal/protonwrapper/netty/AMQPChannelHandler.kt +++ b/node-api/src/main/kotlin/net/corda/nodeapi/internal/protonwrapper/netty/AMQPChannelHandler.kt @@ -122,10 +122,10 @@ internal class AMQPChannelHandler(private val serverMode: Boolean, is SendableMessageImpl -> { val inetAddress = InetSocketAddress(msg.destinationLink.host, msg.destinationLink.port) require(inetAddress == remoteAddress) { - "Message for incorrect endpoint" + "Message for incorrect endpoint $inetAddress expected $remoteAddress" } require(CordaX500Name.parse(msg.destinationLegalName) == CordaX500Name.build(remoteCert!!.subjectX500Principal)) { - "Message for incorrect legal identity" + "Message for incorrect legal identity ${msg.destinationLegalName} expected ${remoteCert!!.subjectX500Principal}" } log.debug { "channel write ${msg.applicationProperties["_AMQ_DUPL_ID"]}" } eventProcessor!!.transportWriteMessage(msg)