activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From clebertsuco...@apache.org
Subject [2/3] activemq-artemis git commit: Send supported versions back in STOMP ERROR version
Date Mon, 13 Jul 2015 20:50:55 GMT
Send supported versions back in STOMP ERROR version

https://stomp.github.io/stomp-specification-1.2.html#Protocol_Negotiation


Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/9e41d961
Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/9e41d961
Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/9e41d961

Branch: refs/heads/master
Commit: 9e41d961beaa0a8bf76514afd8715d61560b8286
Parents: 6199d4e
Author: Ville Skyttä <ville.skytta@iki.fi>
Authored: Mon Jul 13 23:16:55 2015 +0300
Committer: Clebert Suconic <clebertsuconic@apache.org>
Committed: Mon Jul 13 16:50:36 2015 -0400

----------------------------------------------------------------------
 .../artemis/core/protocol/stomp/StompConnection.java      |  2 +-
 .../artemis/core/protocol/stomp/StompProtocolManager.java | 10 ++++++++++
 2 files changed, 11 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/9e41d961/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/StompConnection.java
----------------------------------------------------------------------
diff --git a/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/StompConnection.java
b/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/StompConnection.java
index f172b39..cf67df4 100644
--- a/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/StompConnection.java
+++ b/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/StompConnection.java
@@ -491,7 +491,7 @@ public final class StompConnection implements RemotingConnection
          {
             //not a supported version!
             ActiveMQStompException error = BUNDLE.versionNotSupported(acceptVersion);
-            error.addHeader(Stomp.Headers.Error.VERSION, acceptVersion);
+            error.addHeader(Stomp.Headers.Error.VERSION, manager.getSupportedVersionsAsErrorVersion());
             error.addHeader(Stomp.Headers.CONTENT_TYPE, "text/plain");
             error.setBody("Supported protocol versions are " + manager.getSupportedVersionsAsString());
             error.setDisconnect(true);

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/9e41d961/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/StompProtocolManager.java
----------------------------------------------------------------------
diff --git a/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/StompProtocolManager.java
b/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/StompProtocolManager.java
index b9c36c1..fa9d0c0 100644
--- a/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/StompProtocolManager.java
+++ b/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/StompProtocolManager.java
@@ -387,6 +387,16 @@ class StompProtocolManager implements ProtocolManager<StompFrameInterceptor>,
No
       return versions.substring(1);
    }
 
+   public String getSupportedVersionsAsErrorVersion()
+   {
+      String versions = "";
+      for (StompVersions version : StompVersions.values())
+      {
+         versions += "," + version;
+      }
+      return versions.substring(1);
+   }
+
    public String getVirtualHostName()
    {
       return "activemq";


Mime
View raw message