From e0ee9003a668ea0d2e59fe5cbe28da48d5125758 Mon Sep 17 00:00:00 2001 From: Richard Fuchs Date: Thu, 20 Feb 2025 12:54:22 -0400 Subject: [PATCH] MT#62181 timer: provide copy constructor This makes it possible to retain the previously set absolute expiry time. Update trans_timer to use this (the only relevant place). Change-Id: I9765fbeddd2807406d2603b3c7fd9e8c9c09db68 --- core/sip/sip_trans.h | 2 +- core/sip/wheeltimer.h | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/core/sip/sip_trans.h b/core/sip/sip_trans.h index b434e247..0cd0d5fe 100644 --- a/core/sip/sip_trans.h +++ b/core/sip/sip_trans.h @@ -97,7 +97,7 @@ public: {} trans_timer(const trans_timer& ti, int bucket_id, sip_trans* t) - : timer(ti.expires), type(ti.type), + : timer(ti), type(ti.type), bucket_id(bucket_id), t(t) {} diff --git a/core/sip/wheeltimer.h b/core/sip/wheeltimer.h index a87325d1..26760d13 100644 --- a/core/sip/wheeltimer.h +++ b/core/sip/wheeltimer.h @@ -70,6 +70,11 @@ public: prev(0), expires(0), expires_rel(expires) {} + timer(const timer &t) + : base_timer(), + prev(0), expires(t.expires), expires_rel(t.expires_rel) + {} + ~timer(); virtual void fire()=0;