Skip to content

Commit dfe1d93

Browse files
committed
b2b_entities: insert entity in hash before callback
1 parent 247b7d5 commit dfe1d93

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

modules/b2b_entities/b2be_clustering.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -454,18 +454,17 @@ int receive_entity_create(bin_packet_t *packet, b2b_dlg_t *dlg, int type,
454454
new_dlg->legs = new_leg;
455455

456456
lock_get(&htable[h_idx].lock);
457-
htable[h_idx].locked_by = process_no;
458-
459-
b2b_run_cb(new_dlg, type, B2BCB_RECV_EVENT, B2B_EVENT_CREATE, packet);
460-
461-
htable[h_idx].locked_by = -1;
462457

463458
new_key = b2b_htable_insert(htable, new_dlg, hash_index, type, 1, 1);
464459
if (new_key == NULL) {
465460
LM_ERR("Failed to insert new record\n");
466461
goto error;
467462
}
468463

464+
htable[h_idx].locked_by = process_no;
465+
b2b_run_cb(new_dlg, type, B2BCB_RECV_EVENT, B2B_EVENT_CREATE, packet);
466+
htable[h_idx].locked_by = -1;
467+
469468
lock_release(&htable[h_idx].lock);
470469

471470
pkg_free(new_key);

0 commit comments

Comments
 (0)