activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chir...@apache.org
Subject svn commit: r1212035 - /activemq/activemq-apollo/trunk/apollo-stomp/src/main/scala/org/apache/activemq/apollo/stomp/StompProtocolHandler.scala
Date Thu, 08 Dec 2011 19:05:13 GMT
Author: chirino
Date: Thu Dec  8 19:05:13 2011
New Revision: 1212035

URL: http://svn.apache.org/viewvc?rev=1212035&view=rev
Log:
Small perf optimization.

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=1212035&r1=1212034&r2=1212035&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
Thu Dec  8 19:05:13 2011
@@ -498,7 +498,7 @@ class StompProtocolHandler extends Proto
   val security_context = new SecurityContext
   var waiting_on:String = "client request"
   var config:StompDTO = _
-  var session_id:AsciiBuffer = _
+  var session_id:String = _
 
   var protocol_filters = List[ProtocolFilter]()
 
@@ -820,9 +820,9 @@ class StompProtocolHandler extends Proto
       var connected_headers = ListBuffer((VERSION, protocol_version))
 
       connected_headers += SERVER->encode_header("apache-apollo/"+Broker.version)
-
-      session_id = encode_header("%s-%x-".format(this.host.config.id, this.host.session_counter.incrementAndGet))
-      connected_headers += SESSION->session_id
+      val v = encode_header("%s-%x-".format(this.host.config.id, this.host.session_counter.incrementAndGet))
+      session_id = v.toString 
+      connected_headers += SESSION->v
 
       val outbound_heart_beat_header = ascii("%d,%d".format(outbound_heartbeat,inbound_heartbeat))
       connected_headers += HEART_BEAT->outbound_heart_beat_header
@@ -987,8 +987,7 @@ class StompProtocolHandler extends Proto
     // Do we need to add the message id?
     if( get( headers, MESSAGE_ID) == None ) {
       message_id_counter += 1
-      val msgid: Buffer = session_id + encode_header(message_id_counter.toString())
-      rc ::= (MESSAGE_ID -> msgid.ascii)
+      rc ::= (MESSAGE_ID -> ascii(session_id+message_id_counter))
     }
 
     if( config.add_timestamp_header!=null ) {



Mime
View raw message