|
37 | 37 | #include "b2be_clustering.h"
|
38 | 38 | #include "b2b_entities.h"
|
39 | 39 | #include "b2be_db.h"
|
| 40 | +#include "../../pt.h" |
40 | 41 |
|
41 | 42 | #define NO_REPL_CONSTANT_STRS 10
|
42 | 43 |
|
@@ -456,14 +457,16 @@ int receive_entity_create(bin_packet_t *packet, b2b_dlg_t *dlg, int type,
|
456 | 457 |
|
457 | 458 | lock_get(&htable[h_idx].lock);
|
458 | 459 |
|
459 |
| - b2b_run_cb(new_dlg, type, B2BCB_RECV_EVENT, B2B_EVENT_CREATE, packet); |
460 |
| - |
461 | 460 | new_key = b2b_htable_insert(htable, new_dlg, hash_index, type, 1, 1);
|
462 | 461 | if (new_key == NULL) {
|
463 | 462 | LM_ERR("Failed to insert new record\n");
|
464 | 463 | goto error;
|
465 | 464 | }
|
466 | 465 |
|
| 466 | + htable[h_idx].locked_by = process_no; |
| 467 | + b2b_run_cb(new_dlg, type, B2BCB_RECV_EVENT, B2B_EVENT_CREATE, packet); |
| 468 | + htable[h_idx].locked_by = -1; |
| 469 | + |
467 | 470 | lock_release(&htable[h_idx].lock);
|
468 | 471 |
|
469 | 472 | pkg_free(new_key);
|
@@ -551,7 +554,9 @@ int receive_entity_update(bin_packet_t *packet)
|
551 | 554 | if (packet->type == REPL_ENTITY_UPDATE) {
|
552 | 555 | unpack_update_fields(packet, dlg);
|
553 | 556 |
|
| 557 | + htable[hash_index].locked_by = process_no; |
554 | 558 | b2b_run_cb(dlg, type, B2BCB_RECV_EVENT, B2B_EVENT_UPDATE, packet);
|
| 559 | + htable[hash_index].locked_by = -1; |
555 | 560 | } else {
|
556 | 561 | rc = recv_b2bl_param_update(packet, dlg);
|
557 | 562 | }
|
@@ -605,7 +610,9 @@ int receive_entity_delete(bin_packet_t *packet)
|
605 | 610 | return 0;
|
606 | 611 | }
|
607 | 612 |
|
| 613 | + htable[hash_index].locked_by = process_no; |
608 | 614 | b2b_run_cb(dlg, type, B2BCB_RECV_EVENT, B2B_EVENT_DELETE, packet);
|
| 615 | + htable[hash_index].locked_by = -1; |
609 | 616 |
|
610 | 617 | b2b_entity_db_delete(type, dlg);
|
611 | 618 | b2b_delete_record(dlg, htable, hash_index);
|
|
0 commit comments