Browse code

sip transaction timer fix

Raphael Coeffic authored on 24/09/2012 18:02:03
Showing 1 changed files
... ...
@@ -156,6 +156,15 @@ void trans_timer::fire()
156 156
 	    DBG("Transaction timer expired: type=%c, trans=%p, eta=%i, t=%i\n",
157 157
 		timer_name(type),t,expires,wheeltimer::instance()->wall_clock);
158 158
 
159
+	    trans_timer* tt = t->get_timer(this->type & 0xFFFF);
160
+	    if(tt != this) {
161
+		// timer has been reset while very close to firing!!!
162
+		// 1. it is not yet deleted in the wheeltimer
163
+		// 2. we have already set a new one
164
+		// -> anyway, don't fire the old one !!!
165
+		return;
166
+	    }
167
+
159 168
 	    // timer_expired unlocks the bucket
160 169
 	    trans_layer::instance()->timer_expired(this,bucket,t);
161 170
 	}