Browse Source

pv: use msg pid to check the integrity of cached time

- safer when dealing with async or failure processing
(cherry picked from commit cc33486a8c17ae2cb4cbb5fce42f7a73646cd3c1)
Daniel-Constantin Mierla 14 years ago
parent
commit
24f138c9c3
1 changed files with 4 additions and 1 deletions
  1. 4 1
      modules_k/pv/pv_time.c

+ 4 - 1
modules_k/pv/pv_time.c

@@ -36,13 +36,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;