summaryrefslogtreecommitdiff
path: root/cpp/src/qpid
diff options
context:
space:
mode:
authorGordon Sim <gsim@apache.org>2008-10-13 19:24:26 +0000
committerGordon Sim <gsim@apache.org>2008-10-13 19:24:26 +0000
commitc232b5c0f6090aeb77440e25e3c0b2b59eeb422a (patch)
tree4aa94c717e3e8cc906c2638ef1cdae564d804d9a /cpp/src/qpid
parent56db469f2b6592f8550c54c1f020affc4049e80d (diff)
downloadqpid-python-c232b5c0f6090aeb77440e25e3c0b2b59eeb422a.tar.gz
Optimisation for testing expiration and disabling of setting timestamp until performance impact is evaluated
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@704211 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid')
-rw-r--r--cpp/src/qpid/broker/Message.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/cpp/src/qpid/broker/Message.cpp b/cpp/src/qpid/broker/Message.cpp
index e5a167bd4e..0e37dabe8a 100644
--- a/cpp/src/qpid/broker/Message.cpp
+++ b/cpp/src/qpid/broker/Message.cpp
@@ -307,11 +307,14 @@ void Message::addTraceId(const std::string& id)
void Message::setTimestamp()
{
- time_t now = ::time(0);
DeliveryProperties* props = getProperties<DeliveryProperties>();
- props->setTimestamp(now);
+ //Spec states that timestamp should be set, evaluate the
+ //performance impact before re-enabling this:
+ //time_t now = ::time(0);
+ //props->setTimestamp(now);
if (props->getTtl()) {
//set expiration (nb: ttl is in millisecs, time_t is in secs)
+ time_t now = ::time(0);
props->setExpiration(now + (props->getTtl()/1000));
expiration = AbsTime(AbsTime::now(), Duration(props->getTtl() * TIME_MSEC));
}
@@ -319,5 +322,5 @@ void Message::setTimestamp()
bool Message::hasExpired() const
{
- return expiration < AbsTime::now();
+ return expiration < FAR_FUTURE && expiration < AbsTime::now();
}