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

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


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

commit c27e27c2c30f6d728d8dc1e6b8ea7c5c8a02c1b0
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