Fixes SER-317:
authorMiklos Tirpak <miklos@iptel.org>
Wed, 3 Oct 2007 08:11:35 +0000 (08:11 +0000)
committerMiklos Tirpak <miklos@iptel.org>
Wed, 3 Oct 2007 08:11:35 +0000 (08:11 +0000)
Under heavy load some transactions time out after
fr_timer expires even though 180 response
was received and forwarded to the caller.

modules/tm/timer.h

index 4cbb521..acfd5ee 100644 (file)
@@ -143,7 +143,7 @@ inline static int _set_fr_retr(struct retr_buf* rb, ticks_t retr)
                ((s_ticks_t)(eol-(ticks+timeout))<0)) ){ /* fr after end of life */
                timeout=(((s_ticks_t)(eol-ticks))>0)?(eol-ticks):1; /* expire now */ 
        }
-       rb->fr_expire=ticks+timeout;
+       atomic_cmpxchg_int((void*)&rb->fr_expire, 0, (int)(ticks+timeout));
 #ifdef TIMER_DEBUG
        ret=timer_add_safe(&(rb)->timer, (timeout<retr)?timeout:retr,
                                                        file, func, line);