From 3f6bd06a2515603d1b4f0133e529919b6d9a30e7 Mon Sep 17 00:00:00 2001 From: Gordon Sim Date: Mon, 8 Jun 2009 17:39:24 +0000 Subject: If expiration is already set, don't alter it. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@782712 13f79535-47bb-0310-9956-ffa450edef68 --- cpp/src/qpid/broker/Message.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'cpp/src/qpid/broker') diff --git a/cpp/src/qpid/broker/Message.cpp b/cpp/src/qpid/broker/Message.cpp index 1e9eb9d386..3f4f63e48c 100644 --- a/cpp/src/qpid/broker/Message.cpp +++ b/cpp/src/qpid/broker/Message.cpp @@ -326,8 +326,11 @@ void Message::setTimestamp(const boost::intrusive_ptr& e) if (props->getTtl()) { // AMQP requires setting the expiration property to be posix // time_t in seconds. TTL is in milliseconds - time_t now = ::time(0); - props->setExpiration(now + (props->getTtl()/1000)); + if (!props->getExpiration()) { + //only set expiration in delivery properties if not already set + time_t now = ::time(0); + props->setExpiration(now + (props->getTtl()/1000)); + } // Use higher resolution time for the internal expiry calculation. expiration = AbsTime(AbsTime::now(), Duration(props->getTtl() * TIME_MSEC)); setExpiryPolicy(e); -- cgit v1.2.1