diff options
| author | Gordon Sim <gsim@apache.org> | 2013-09-20 15:43:49 +0000 |
|---|---|---|
| committer | Gordon Sim <gsim@apache.org> | 2013-09-20 15:43:49 +0000 |
| commit | 2d711855fc6acd806e1ced1703051bb3594e3abe (patch) | |
| tree | 2dbfdbeb6df8809e553682cfef685b7a2258778b /qpid/cpp/src | |
| parent | 7da77d485b85a36199de80b88a501e414c1ec4eb (diff) | |
| download | qpid-python-2d711855fc6acd806e1ced1703051bb3594e3abe.tar.gz | |
QPID-5148: proper handling of ttl on 1.0 path
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1525042 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp/src')
| -rw-r--r-- | qpid/cpp/src/qpid/broker/Message.cpp | 2 | ||||
| -rw-r--r-- | qpid/cpp/src/qpid/broker/Message.h | 2 | ||||
| -rw-r--r-- | qpid/cpp/src/qpid/broker/amqp/Incoming.cpp | 4 | ||||
| -rw-r--r-- | qpid/cpp/src/qpid/broker/amqp/Incoming.h | 1 |
4 files changed, 6 insertions, 3 deletions
diff --git a/qpid/cpp/src/qpid/broker/Message.cpp b/qpid/cpp/src/qpid/broker/Message.cpp index 197d097183..e71125b4ab 100644 --- a/qpid/cpp/src/qpid/broker/Message.cpp +++ b/qpid/cpp/src/qpid/broker/Message.cpp @@ -145,7 +145,7 @@ uint64_t Message::getTtl() const } } -bool Message::getTtl(uint64_t ttl) const +bool Message::getTtl(uint64_t& ttl) const { if (encoding->getTtl(ttl) && expiration < FAR_FUTURE) { sys::Duration remaining(sys::AbsTime::now(), getExpiration()); diff --git a/qpid/cpp/src/qpid/broker/Message.h b/qpid/cpp/src/qpid/broker/Message.h index eff40e2207..84f62a771d 100644 --- a/qpid/cpp/src/qpid/broker/Message.h +++ b/qpid/cpp/src/qpid/broker/Message.h @@ -104,7 +104,7 @@ public: sys::AbsTime getExpiration() const { return expiration; } void setExpiration(sys::AbsTime exp) { expiration = exp; } uint64_t getTtl() const; - QPID_BROKER_EXTERN bool getTtl(uint64_t) const; + QPID_BROKER_EXTERN bool getTtl(uint64_t&) const; /** set the timestamp delivery property to the current time-of-day */ QPID_BROKER_EXTERN void setTimestamp(); diff --git a/qpid/cpp/src/qpid/broker/amqp/Incoming.cpp b/qpid/cpp/src/qpid/broker/amqp/Incoming.cpp index 119d05af60..f54328bc2e 100644 --- a/qpid/cpp/src/qpid/broker/amqp/Incoming.cpp +++ b/qpid/cpp/src/qpid/broker/amqp/Incoming.cpp @@ -25,6 +25,7 @@ #include "qpid/amqp/descriptors.h" #include "qpid/broker/AsyncCompletion.h" #include "qpid/broker/Message.h" +#include "qpid/broker/Broker.h" namespace qpid { namespace broker { @@ -104,7 +105,7 @@ namespace { } DecodingIncoming::DecodingIncoming(pn_link_t* link, Broker& broker, Session& parent, const std::string& source, const std::string& target, const std::string& name) - : Incoming(link, broker, parent, source, target, name), session(parent.shared_from_this()) {} + : Incoming(link, broker, parent, source, target, name), session(parent.shared_from_this()), expiryPolicy(broker.getExpiryPolicy()) {} DecodingIncoming::~DecodingIncoming() {} void DecodingIncoming::readable(pn_delivery_t* delivery) @@ -116,6 +117,7 @@ void DecodingIncoming::readable(pn_delivery_t* delivery) qpid::broker::Message message(received, received); userid.verify(message.getUserId()); + message.computeExpiration(expiryPolicy); handle(message); --window; received->begin(); diff --git a/qpid/cpp/src/qpid/broker/amqp/Incoming.h b/qpid/cpp/src/qpid/broker/amqp/Incoming.h index 8852766eda..127f8cecf9 100644 --- a/qpid/cpp/src/qpid/broker/amqp/Incoming.h +++ b/qpid/cpp/src/qpid/broker/amqp/Incoming.h @@ -77,6 +77,7 @@ class DecodingIncoming : public Incoming virtual void handle(qpid::broker::Message&) = 0; private: boost::shared_ptr<Session> session; + boost::intrusive_ptr<ExpiryPolicy> expiryPolicy; }; }}} // namespace qpid::broker::amqp |
