Skip to content

Commit ba76f92

Browse files
committed
clusterer: keep stock code as upstream has it
Drop a NULL check on cl->current_node in mod_init that the check right above it already makes impossible, and restore three comments the series had removed. A build without clusterer_controller now compiles clusterer to the same objects as master.
1 parent 3f8fde4 commit ba76f92

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

‎modules/clusterer/clusterer_mod.c‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -523,6 +523,7 @@ static int mod_init(void)
523523
db_mode = 0;
524524
#endif
525525

526+
/* only allow the DB URL to be skipped in "P2P discovery" mode */
526527
init_db_url(clusterer_db_url, db_mode == 0);
527528

528529
#ifdef CLUSTERER_CTRL_SUPPORT
@@ -603,7 +604,7 @@ static int mod_init(void)
603604
goto error;
604605
}
605606

606-
if (cl->current_node && cl->current_node->node_id != current_id) {
607+
if (cl->current_node->node_id != current_id) {
607608
LM_ERR("Bad 'my_node_id' parameter, value: %d different than"
608609
" the node_id property in the 'my_node_info' parameter\n", GET_CURRENT_ID);
609610
goto error;
@@ -618,6 +619,7 @@ static int mod_init(void)
618619
* ones. Static my_node_info/neighbor provisioning (db_mode==0) has already
619620
* populated cluster_list at config-parse time. */
620621
if (db_mode) {
622+
/* bind to the mysql module */
621623
if (db_bind_mod(&clusterer_db_url, &dr_dbf)) {
622624
LM_CRIT("Cannot bind to database module! "
623625
"Did you forget to load a database module ?\n");
@@ -627,6 +629,7 @@ static int mod_init(void)
627629
LM_CRIT("Given SQL DB does not provide query types needed by this module!\n");
628630
goto error;
629631
}
632+
/* init DB connection */
630633
if ((db_hdl = dr_dbf.init(&clusterer_db_url)) == 0) {
631634
LM_ERR("cannot initialize database connection\n");
632635
goto error;

0 commit comments

Comments
 (0)