- fix ordering change to standar mode introduced with proportional mode
- GH #2449
(cherry picked from commit 59f6ddbe902d61bc682dd12fc6330df656468b1b)
... | ... |
@@ -459,11 +459,20 @@ int ki_t_load_contacts_mode(struct sip_msg* msg, int mode) |
459 | 459 |
|
460 | 460 |
prev = (struct contact *)0; |
461 | 461 |
curr = contacts; |
462 |
- while (curr && |
|
463 |
- ((curr->q_index < next->q_index) || |
|
464 |
- ((curr->q_index == next->q_index) && (next->path.len == 0)))) { |
|
465 |
- prev = curr; |
|
466 |
- curr = curr->next; |
|
462 |
+ if (mode == T_LOAD_PROPORTIONAL) { |
|
463 |
+ while (curr && |
|
464 |
+ ((curr->q_index < next->q_index) || |
|
465 |
+ ((curr->q_index == next->q_index) && (next->path.len == 0)))) { |
|
466 |
+ prev = curr; |
|
467 |
+ curr = curr->next; |
|
468 |
+ } |
|
469 |
+ } else { |
|
470 |
+ while (curr && |
|
471 |
+ ((curr->q < next->q) || |
|
472 |
+ ((curr->q == next->q) && (next->path.len == 0)))) { |
|
473 |
+ prev = curr; |
|
474 |
+ curr = curr->next; |
|
475 |
+ } |
|
467 | 476 |
} |
468 | 477 |
if (!curr) { |
469 | 478 |
next->next = (struct contact *)0; |