Module: sip-router
Branch: 3.1
Commit: e996c929c4bbb65d42264711e156b8f16f7ee05f
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=e996c92…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: Tue Nov 22 11:30:02 2011 +0100
pv: use msg pid to check the integrity of cached time
- safer when dealing with async or failure processing
(cherry picked from commit cc33486a8c17ae2cb4cbb5fce42f7a73646cd3c1)
(cherry picked from commit 24f138c9c39ac6475347ed76e311e1759d4d8531)
---
modules_k/pv/pv_time.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/modules_k/pv/pv_time.c b/modules_k/pv/pv_time.c
index 399170c..6a4393d 100644
--- a/modules_k/pv/pv_time.c
+++ b/modules_k/pv/pv_time.c
@@ -35,13 +35,16 @@
#include "pv_time.h"
static unsigned int _pv_msg_id = 0;
+static int _pv_msg_pid = 0;
static time_t _pv_msg_tm = 0;
+
static int pv_update_time(struct sip_msg *msg, time_t *t)
{
- if(_pv_msg_id != msg->id || _pv_msg_tm==0)
+ if(_pv_msg_id != msg->id || _pv_msg_pid != msg->pid || _pv_msg_tm==0)
{
_pv_msg_tm = time(NULL);
_pv_msg_id = msg->id;
+ _pv_msg_pid = msg->pid;
if(t!=NULL)
*t=_pv_msg_tm;