This is an automated email from the ASF dual-hosted git repository.

jbonofre pushed a commit to branch activemq-5.15.x
in repository https://gitbox.apache.org/repos/asf/activemq.git


The following commit(s) were added to refs/heads/activemq-5.15.x by this push:
     new de3cfac  [AMQ-7444] Fallback to remote location for remote address 
when socket has not been created yet
de3cfac is described below

commit de3cfaca69738964bd24381ee2ca73cde9857822
Author: jbonofre <[email protected]>
AuthorDate: Wed Jan 13 11:41:17 2021 +0100

    [AMQ-7444] Fallback to remote location for remote address when socket has 
not been created yet
    
    (cherry picked from commit 0c1b3e9240dbda0aee0426bfcef5e9cc628af7c7)
---
 .../apache/activemq/transport/stomp/StompNIOSSLTransport.java | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git 
a/activemq-stomp/src/main/java/org/apache/activemq/transport/stomp/StompNIOSSLTransport.java
 
b/activemq-stomp/src/main/java/org/apache/activemq/transport/stomp/StompNIOSSLTransport.java
index cb199ae..d2e394b 100644
--- 
a/activemq-stomp/src/main/java/org/apache/activemq/transport/stomp/StompNIOSSLTransport.java
+++ 
b/activemq-stomp/src/main/java/org/apache/activemq/transport/stomp/StompNIOSSLTransport.java
@@ -49,14 +49,21 @@ public class StompNIOSSLTransport extends NIOSSLTransport {
         super(wireFormat, socket, null, null, null);
     }
 
-
-
     public StompNIOSSLTransport(WireFormat wireFormat, Socket socket,
             SSLEngine engine, InitBuffer initBuffer, ByteBuffer inputBuffer) 
throws IOException {
         super(wireFormat, socket, engine, initBuffer, inputBuffer);
     }
 
     @Override
+    public String getRemoteAddress() {
+        String remoteAddress = super.getRemoteAddress();
+        if (remoteAddress == null) {
+            return remoteLocation.toString();
+        }
+        return remoteAddress;
+    }
+
+    @Override
     protected void initializeStreams() throws IOException {
         codec = new StompCodec(this);
         super.initializeStreams();

Reply via email to