activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject git commit: https://issues.apache.org/jira/browse/AMQCPP-515
Date Mon, 07 Oct 2013 13:54:29 GMT
Updated Branches:
  refs/heads/trunk 06a7435df -> efd6e7b93


https://issues.apache.org/jira/browse/AMQCPP-515

Fix overwriting newer property values with older ones in Stomp.


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

Branch: refs/heads/trunk
Commit: efd6e7b933b077f5c535c9bfe45eee1c7c6e32cf
Parents: 06a7435
Author: Timothy Bish <tabish121@gmai.com>
Authored: Mon Oct 7 09:53:26 2013 -0400
Committer: Timothy Bish <tabish121@gmai.com>
Committed: Mon Oct 7 09:54:12 2013 -0400

----------------------------------------------------------------------
 .../src/main/activemq/wireformat/stomp/StompFrame.cpp         | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-cpp/blob/efd6e7b9/activemq-cpp/src/main/activemq/wireformat/stomp/StompFrame.cpp
----------------------------------------------------------------------
diff --git a/activemq-cpp/src/main/activemq/wireformat/stomp/StompFrame.cpp b/activemq-cpp/src/main/activemq/wireformat/stomp/StompFrame.cpp
index 42918d2..511dc78 100644
--- a/activemq-cpp/src/main/activemq/wireformat/stomp/StompFrame.cpp
+++ b/activemq-cpp/src/main/activemq/wireformat/stomp/StompFrame.cpp
@@ -105,7 +105,6 @@ void StompFrame::toStream(decaf::io::DataOutputStream* stream) const {
     }
 
     if ((this->getBodyLength() == 0) || (this->getProperty(StompCommandConstants::HEADER_CONTENTLENGTH)
!= "")) {
-
         stream->write('\0');
     }
 
@@ -196,9 +195,7 @@ void StompFrame::readHeaders(decaf::io::DataInputStream* in) {
             // Check for an empty line to demark the end of the header section.
             // if its not the end then we have a header to process, so parse it.
             if (numChars == 1 && buffer[0] == '\0') {
-
                 endOfHeaders = true;
-
             } else {
 
                 // Search through this line to separate the key/value pair.
@@ -214,7 +211,9 @@ void StompFrame::readHeaders(decaf::io::DataInputStream* in) {
                         const char* value = reinterpret_cast<char*>(&buffer[ix
+ 1]);
 
                         // Assign the header key/value pair.
-                        this->getProperties().setProperty(key, value);
+                        if (!this->getProperties().hasProperty(key)) {
+                            this->getProperties().setProperty(key, value);
+                        }
 
                         // Break out of the for loop.
                         break;


Mime
View raw message