diff options
author | Gordon Sim <gsim@apache.org> | 2008-10-13 19:24:26 +0000 |
---|---|---|
committer | Gordon Sim <gsim@apache.org> | 2008-10-13 19:24:26 +0000 |
commit | 83c55468b36106b76aacd11e6bb51446a066e8e4 (patch) | |
tree | 3f4399ea69b0c3a2b3a9310600832c1070f701c2 /qpid | |
parent | 687bd1074ebe8e88c2cbaf18db952b0b8573c820 (diff) | |
download | qpid-python-83c55468b36106b76aacd11e6bb51446a066e8e4.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@704211 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid')
-rw-r--r-- | qpid/cpp/src/qpid/broker/Message.cpp | 9 |
1 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 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<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(); } |