activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chir...@apache.org
Subject svn commit: r1331585 - /activemq/activemq-apollo/trunk/apollo-stomp/src/main/scala/org/apache/activemq/apollo/stomp/StompProtocolHandler.scala
Date Fri, 27 Apr 2012 20:39:21 GMT
Author: chirino
Date: Fri Apr 27 20:39:21 2012
New Revision: 1331585

URL: http://svn.apache.org/viewvc?rev=1331585&view=rev
Log:
keep it simple. copy all the subscribe headers.

Modified:
    activemq/activemq-apollo/trunk/apollo-stomp/src/main/scala/org/apache/activemq/apollo/stomp/StompProtocolHandler.scala

Modified: activemq/activemq-apollo/trunk/apollo-stomp/src/main/scala/org/apache/activemq/apollo/stomp/StompProtocolHandler.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-stomp/src/main/scala/org/apache/activemq/apollo/stomp/StompProtocolHandler.scala?rev=1331585&r1=1331584&r2=1331585&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-stomp/src/main/scala/org/apache/activemq/apollo/stomp/StompProtocolHandler.scala
(original)
+++ activemq/activemq-apollo/trunk/apollo-stomp/src/main/scala/org/apache/activemq/apollo/stomp/StompProtocolHandler.scala
Fri Apr 27 20:39:21 2012
@@ -819,7 +819,7 @@ class StompProtocolHandler extends Proto
               case ABORT =>
                 on_stomp_abort(frame.headers)
               case SUBSCRIBE =>
-                on_stomp_subscribe(frame.headers)
+                on_stomp_subscribe(deep_copy(frame.headers))
               case UNSUBSCRIBE =>
                 on_stomp_unsubscribe(frame.headers)
               case NACK =>
@@ -1225,7 +1225,14 @@ class StompProtocolHandler extends Proto
     frame.release
   }
 
+  def deep_copy(headers:HeaderMap) = {
+    headers.map { header=>
+      (header._1.deepCopy().ascii(), header._2.deepCopy().ascii())
+    }
+  }
+
   def on_stomp_subscribe(headers:HeaderMap):Unit = {
+
     val dest = get(headers, DESTINATION).getOrElse(die("destination not set."))
     var addresses:Array[_ <: BindAddress] = decode_addresses(dest)
 
@@ -1234,7 +1241,7 @@ class StompProtocolHandler extends Proto
       if( protocol_version eq V1_0 ) {
           // in 1.0 it's ok if the client does not send us the
           // the id header
-          dest.deepCopy()
+          dest.deepCopy().ascii()
         } else {
           die("The id header is missing from the SUBSCRIBE frame");
         }



Mime
View raw message