From 83c55468b36106b76aacd11e6bb51446a066e8e4 Mon Sep 17 00:00:00 2001 From: Gordon Sim Date: Mon, 13 Oct 2008 19:24:26 +0000 Subject: 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@704211 13f79535-47bb-0310-9956-ffa450edef68 --- qpid/cpp/src/qpid/broker/Message.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'qpid') diff --git a/qpid/cpp/src/qpid/broker/Message.cpp b/qpid/cpp/src/qpid/broker/Message.cpp index e5a167bd4e..0e37dabe8a 100644 --- a/qpid/cpp/src/qpid/broker/Message.cpp +++ b/qpid/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(); - 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(); } -- cgit v1.2.1