Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion native/balancers/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ LoadModule lbmethod_cluster_module modules/mod_lbmethod_cluster.so
KeepAliveTimeout 300
MaxKeepAliveRequests 0

EnableMCPMReceive
EnableMCMPReceive
ServerName localhost

<Location /mod_cluster_manager>
Expand Down
42 changes: 27 additions & 15 deletions native/mod_manager/mod_manager.c
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,8 @@ typedef struct mod_manager_config
int reduce_display;
/* maximum message size */
int maxmesssize;
/* Enable MCPM receiver */
int enable_mcpm_receive;
/* Enable MCMP receiver */
int enable_mcmp_receive;
/* Enable WebSocket Proxy */
int enable_ws_tunnel;
/* WebSocket upgrade header */
Expand Down Expand Up @@ -2589,7 +2589,7 @@ static int manager_trans(request_rec *r)
if (r->method_number != M_INVALID) {
return DECLINED;
}
if (!mconf->enable_mcpm_receive) {
if (!mconf->enable_mcmp_receive) {
return DECLINED; /* Not allowed to receive MCMP */
}

Expand Down Expand Up @@ -2619,7 +2619,7 @@ static int manager_map_to_storage(request_rec *r)
if (r->method_number != M_INVALID) {
return DECLINED;
}
if (!mconf->enable_mcpm_receive) {
if (!mconf->enable_mcmp_receive) {
return DECLINED; /* Not allowed to receive MCMP */
}

Expand Down Expand Up @@ -3351,7 +3351,7 @@ static int manager_handler(request_rec *r)
}

mconf = ap_get_module_config(r->server->module_config, &manager_module);
if (!mconf->enable_mcpm_receive) {
if (!mconf->enable_mcmp_receive) {
return DECLINED; /* Not allowed to receive MCMP */
}

Expand Down Expand Up @@ -3705,18 +3705,27 @@ static const char *cmd_manager_maxmesssize(cmd_parms *cmd, void *mconfig, const
return NULL;
}

static const char *cmd_manager_enable_mcpm_receive(cmd_parms *cmd, void *dummy)
static const char *cmd_manager_enable_mcmp_receive(cmd_parms *cmd, void *dummy)
{
mod_manager_config *mconf = ap_get_module_config(cmd->server->module_config, &manager_module);
(void)dummy;

if (!cmd->server->is_virtual) {
return "EnableMCPMReceive must be in a VirtualHost";
return "EnableMCMPReceive must be in a VirtualHost";
}
mconf->enable_mcpm_receive = 1;
mconf->enable_mcmp_receive = 1;
return NULL;
}

static const char *cmd_manager_enable_mcmp_receive_deprecated(cmd_parms *cmd, void *dummy)
{
ap_log_error(APLOG_MARK, APLOG_WARNING, 0, cmd->server,
"EnableMCPMReceive is deprecated misspelled version of 'EnableMCMPReceive' configuration option. "
"Please update your configuration.");

return cmd_manager_enable_mcmp_receive(cmd, dummy);
}

static const char *cmd_manager_enable_ws_tunnel(cmd_parms *cmd, void *dummy)
{
mod_manager_config *mconf = ap_get_module_config(cmd->server->module_config, &manager_module);
Expand Down Expand Up @@ -3826,8 +3835,11 @@ static const command_rec manager_cmds[] = {
"displayed)"),
AP_INIT_TAKE1("MaxMCMPMessSize", cmd_manager_maxmesssize, NULL, OR_ALL,
"MaxMCMPMaxMessSize - Maximum size of MCMP messages. (Default: calculated min value: 1024)"),
AP_INIT_NO_ARGS("EnableMCPMReceive", cmd_manager_enable_mcpm_receive, NULL, OR_ALL,
"EnableMCPMReceive - Allow the VirtualHost to receive MCPM."),
AP_INIT_NO_ARGS("EnableMCMPReceive", cmd_manager_enable_mcmp_receive, NULL, OR_ALL,
"EnableMCMPReceive - Allow the VirtualHost to receive MCMP."),
AP_INIT_NO_ARGS("EnableMCPMReceive", cmd_manager_enable_mcmp_receive_deprecated, NULL, OR_ALL,
"EnableMCPMReceive - Deprecated misspelled version of 'EnableMCMPReceive' configuration option "
"kept in for configuration backwards compatibility."),
AP_INIT_NO_ARGS(
"EnableWsTunnel", cmd_manager_enable_ws_tunnel, NULL, OR_ALL,
"EnableWsTunnel - Use ws or wss instead of http or https when creating nodes (allows WebSocket proxying)."),
Expand Down Expand Up @@ -3893,7 +3905,7 @@ static void *create_manager_config(apr_pool_t *p)
mconf->allow_display = 0;
mconf->allow_cmd = -1;
mconf->reduce_display = 0;
mconf->enable_mcpm_receive = 0;
mconf->enable_mcmp_receive = 0;
mconf->enable_ws_tunnel = 0;
mconf->ws_upgrade_header = NULL;
mconf->ajp_secret = NULL;
Expand Down Expand Up @@ -3979,10 +3991,10 @@ static void *merge_manager_server_config(apr_pool_t *p, void *server1_conf, void
mconf->reduce_display = mconf1->reduce_display;
}

if (mconf2->enable_mcpm_receive != 0) {
mconf->enable_mcpm_receive = mconf2->enable_mcpm_receive;
} else if (mconf1->enable_mcpm_receive != 0) {
mconf->enable_mcpm_receive = mconf1->enable_mcpm_receive;
if (mconf2->enable_mcmp_receive != 0) {
mconf->enable_mcmp_receive = mconf2->enable_mcmp_receive;
} else if (mconf1->enable_mcmp_receive != 0) {
mconf->enable_mcmp_receive = mconf1->enable_mcmp_receive;
}

if (mconf2->enable_ws_tunnel != 0) {
Expand Down
2 changes: 1 addition & 1 deletion test/MODCLUSTER-640/mod_proxy_cluster.conf
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ ProxyPreserveHost On
EnableWsTunnel
WSUpgradeHeader websocket
<VirtualHost *:6666>
EnableMCPMReceive
EnableMCMPReceive
<Directory />
Require ip 127.0.0.1
Require ip ::1
Expand Down
2 changes: 1 addition & 1 deletion test/MODCLUSTER-734/mod_proxy_cluster.conf
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ ManagerBalancerName mycluster
ServerName localhost

<VirtualHost *:6666>
EnableMCPMReceive
EnableMCMPReceive
<Directory />
Require ip 127.0.0.1
Require ip ::1
Expand Down
2 changes: 1 addition & 1 deletion test/MODCLUSTER-755/mod_proxy_cluster.conf
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ ManagerBalancerName mycluster
ServerName localhost

<VirtualHost *:6666>
EnableMCPMReceive
EnableMCMPReceive
<Directory />
Require ip 127.0.0.1
Require ip ::1
Expand Down
2 changes: 1 addition & 1 deletion test/MODCLUSTER-785/mod_proxy_cluster.conf
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ EnableWsTunnel
WSUpgradeHeader websocket

<VirtualHost *:6666>
EnableMCPMReceive
EnableMCMPReceive
<Directory />
Require ip 127.0.0.1
Require ip ::1
Expand Down
2 changes: 1 addition & 1 deletion test/MODCLUSTER-794/mod_proxy_cluster.conf
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ WSUpgradeHeader websocket
</IfModule>

<VirtualHost *:6666>
EnableMCPMReceive
EnableMCMPReceive
<Directory />
Require ip 127.0.0.
Require ip ::1
Expand Down
2 changes: 1 addition & 1 deletion test/httpd/mod_lbmethod_cluster.conf
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ ManagerBalancerName mycluster
WSUpgradeHeader websocket

<VirtualHost *:6666>
EnableMCPMReceive
EnableMCMPReceive
<Directory />
Require ip 127.0.0.
Require ip ::1
Expand Down
2 changes: 1 addition & 1 deletion test/httpd/mod_proxy_cluster.conf
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ WSUpgradeHeader websocket
</IfModule>

<VirtualHost *:6666>
EnableMCPMReceive
EnableMCMPReceive
<Directory />
Require ip 127.0.0.
Require ip ::1
Expand Down
2 changes: 1 addition & 1 deletion test/websocket/mod_proxy_cluster.conf
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ ManagerBalancerName mycluster
EnableWsTunnel
WSUpgradeHeader websocket
<VirtualHost *:6666>
EnableMCPMReceive
EnableMCMPReceive
<Directory />
Require ip 127.0.0.
Require ip ::1
Expand Down