Skip to content

Commit

Permalink
[tm] fix setting _tm_branch_index in case of internal timeout
Browse files Browse the repository at this point in the history
Be sure the _tm_branch_index variable is properly set for internal timeout and not only for received replies

(cherry picked from commit 43590e9)
  • Loading branch information
bogdan-iancu committed Nov 28, 2023
1 parent 53d9ccb commit 8b4771d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions modules/tm/timer.c
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,9 @@ static struct timer_table *timertable=0;
static unsigned int timer_sets = 0;
static struct timer detached_timer; /* just to have a value to compare with*/

/* currently processed branch */
extern int _tm_branch_index;

#define DETACHED_LIST (&detached_timer)

#define is_in_timer_list2(_tl) ( (_tl)->timer_list && \
Expand Down Expand Up @@ -248,6 +251,7 @@ static void fake_reply(struct cell *t, int branch, int code )
branch_bm_t cancel_bitmap = 0;
enum rps reply_status;

_tm_branch_index = branch;
if ( is_local(t) ) {
reply_status=local_reply( t, FAKED_REPLY, branch,
code, &cancel_bitmap );
Expand All @@ -258,6 +262,7 @@ static void fake_reply(struct cell *t, int branch, int code )
reply_status=relay_reply( t, FAKED_REPLY, branch, code,
&cancel_bitmap );
}
_tm_branch_index = 0;
/* again, a final negative reply on a branch will never lead to a
* situation to cancel other existing branches, so the
* cancel_bitmap should be empty here (we use it as a dummy holder), so
Expand Down

0 comments on commit 8b4771d

Please sign in to comment.