Derives our ports to be announced in the cluster bus. */
| 457 | |
| 458 | /* Derives our ports to be announced in the cluster bus. */ |
| 459 | void deriveAnnouncedPorts(int *announced_port, int *announced_pport, |
| 460 | int *announced_cport) { |
| 461 | int port = g_pserver->tls_cluster ? g_pserver->tls_port : g_pserver->port; |
| 462 | /* Default announced ports. */ |
| 463 | *announced_port = port; |
| 464 | *announced_pport = g_pserver->tls_cluster ? g_pserver->port : 0; |
| 465 | *announced_cport = port + CLUSTER_PORT_INCR; |
| 466 | /* Config overriding announced ports. */ |
| 467 | if (g_pserver->tls_cluster && g_pserver->cluster_announce_tls_port) { |
| 468 | *announced_port = g_pserver->cluster_announce_tls_port; |
| 469 | *announced_pport = g_pserver->cluster_announce_port; |
| 470 | } else if (g_pserver->cluster_announce_port) { |
| 471 | *announced_port = g_pserver->cluster_announce_port; |
| 472 | } |
| 473 | if (g_pserver->cluster_announce_bus_port) { |
| 474 | *announced_cport = g_pserver->cluster_announce_bus_port; |
| 475 | } |
| 476 | } |
| 477 | |
| 478 | /* Some flags (currently just the NOFAILOVER flag) may need to be updated |
| 479 | * in the "myself" node based on the current configuration of the node, |
no outgoing calls
no test coverage detected