activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r1060990 - in /activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/stomp: StompWireFormat.cpp StompWireFormat.h
Date Wed, 19 Jan 2011 21:13:26 GMT
Author: tabish
Date: Wed Jan 19 21:13:25 2011
New Revision: 1060990

URL: http://svn.apache.org/viewvc?rev=1060990&view=rev
Log:
fix for: https://issues.apache.org/jira/browse/AMQCPP-345

Modified:
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/stomp/StompWireFormat.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/stomp/StompWireFormat.h

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/stomp/StompWireFormat.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/stomp/StompWireFormat.cpp?rev=1060990&r1=1060989&r2=1060990&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/stomp/StompWireFormat.cpp
(original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/stomp/StompWireFormat.cpp
Wed Jan 19 21:13:25 2011
@@ -61,11 +61,38 @@ using namespace decaf::lang;
 using namespace decaf::lang::exceptions;
 
 ////////////////////////////////////////////////////////////////////////////////
-StompWireFormat::StompWireFormat() : helper(), clientId(), receiving() {
+namespace activemq {
+namespace wireformat {
+namespace stomp {
+
+    class StompWireformatProperties {
+    public:
+
+        int connectResponseId;
+
+    public:
+
+        StompWireformatProperties() : connectResponseId(-1) {
+
+        }
+
+    };
+
+}}}
+
+////////////////////////////////////////////////////////////////////////////////
+StompWireFormat::StompWireFormat() : helper(), clientId(), receiving(), properties(NULL)
{
+
+    this->properties = new StompWireformatProperties();
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 StompWireFormat::~StompWireFormat() {
+
+    try{
+        delete this->properties;
+    }
+    AMQ_CATCHALL_NOTHROW()
 }
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -264,9 +291,9 @@ Pointer<Command> StompWireFormat::unmars
 Pointer<Command> StompWireFormat::unmarshalConnected( const Pointer<StompFrame>&
frame ) {
 
     Pointer<Response> response( new Response() );
-    if( frame->hasProperty( StompCommandConstants::HEADER_RESPONSEID ) ) {
-        response->setCorrelationId( Integer::parseInt(
-            frame->getProperty( StompCommandConstants::HEADER_RESPONSEID ) ) );
+
+    if( this->properties->connectResponseId != -1 ) {
+        response->setCorrelationId(this->properties->connectResponseId);
     } else {
         throw IOException(
             __FILE__, __LINE__, "Error, Connected Command has no Response ID." );
@@ -379,8 +406,8 @@ Pointer<StompFrame> StompWireFormat::mar
     frame->setProperty( StompCommandConstants::HEADER_CLIENT_ID, info->getClientId()
);
     frame->setProperty( StompCommandConstants::HEADER_LOGIN, info->getUserName() );
     frame->setProperty( StompCommandConstants::HEADER_PASSWORD, info->getPassword()
);
-    frame->setProperty( StompCommandConstants::HEADER_REQUESTID,
-                        Integer::toString( info->getCommandId() ) );
+
+    this->properties->connectResponseId = info->getCommandId();
 
     // Store this for later.
     this->clientId = info->getClientId();

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/stomp/StompWireFormat.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/stomp/StompWireFormat.h?rev=1060990&r1=1060989&r2=1060990&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/stomp/StompWireFormat.h
(original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/stomp/StompWireFormat.h
Wed Jan 19 21:13:25 2011
@@ -33,6 +33,8 @@ namespace stomp {
     using decaf::lang::Pointer;
     using activemq::commands::Command;
 
+    class StompWireformatProperties;
+
     class AMQCPP_API StompWireFormat : public WireFormat {
     private:
 
@@ -48,6 +50,10 @@ namespace stomp {
         // Indicates when we are in the doUnmarshal call
         decaf::util::concurrent::atomic::AtomicBoolean receiving;
 
+        // Internal structure for holding class internal data that can change without
+        // affecting binary compatibility.
+        StompWireformatProperties* properties;
+
     public:
 
         StompWireFormat();



Mime
View raw message