MCPcopy Create free account
hub / github.com/OpenSIPS/opensips / debug_gen_timer_list

Function debug_gen_timer_list

modules/dialog/dlg_timer.c:119–161  ·  view source on GitHub ↗

assumed to be always called under timer lock */

Source from the content-addressed store, hash-verified

117
118/* assumed to be always called under timer lock */
119void debug_gen_timer_list( struct dlg_timer *timer )
120{
121 static int visited;
122
123 struct dlg_tl *start,*finish;
124
125 visited++;
126 start = finish = &(timer->first);
127 LM_DBG("testing forward loop with visited = %d\n",visited);
128
129 /* check the main list is circular in both directions from start to end,
130 * with no loops in the middle */
131 while (start) {
132 start->visited=visited;
133 start = start->next;
134
135 if (start == finish)
136 break;
137
138 if (start == NULL || start->visited == visited) {
139 LM_ERR("Detected something wrong with main timer list on forward linking for entry %p \n",start);
140 abort();
141 }
142 }
143
144 visited++;
145 start = &(timer->first);
146
147 LM_DBG("testing backward loop with visited = %d\n",visited);
148
149 while (start) {
150 start->visited=visited;
151 start = start->prev;
152
153 if (start == finish)
154 break;
155
156 if (start == NULL || start->visited == visited) {
157 LM_ERR("Detected something wrong with main timer list on backward linking for entry %p \n",start);
158 abort();
159 }
160 }
161}
162
163#endif
164

Callers 3

insert_gen_timer_unsafeFunction · 0.85
remove_dlg_timer_unsafeFunction · 0.85
_get_gen_expired_dlgsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected