Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[1.3.x] MODCLUSTER-551 Fix spelling of EnableMCPMReceive option. #797

Merged
merged 1 commit into from
Apr 17, 2024
Merged
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
43 changes: 29 additions & 14 deletions native/mod_manager/mod_manager.c
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,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 @@ -2368,7 +2368,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 */

ours = check_method(r);
Expand Down Expand Up @@ -2398,7 +2398,7 @@ static int manager_map_to_storage(request_rec *r)
&manager_module);
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 */

ours = check_method(r);
Expand Down Expand Up @@ -3069,7 +3069,7 @@ static int manager_handler(request_rec *r)
}

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

ours = check_method(r);
Expand Down Expand Up @@ -3396,14 +3396,22 @@ static const char*cmd_manager_maxmesssize(cmd_parms *cmd, void *mconfig, const c
return "MaxMCMPMessSize must bigger than 1024";
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);
if (!cmd->server->is_virtual)
return "EnableMCPMReceive 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 @@ -3571,12 +3579,19 @@ static const command_rec manager_cmds[] =
OR_ALL,
"MaxMCMPMaxMessSize - Maximum size of MCMP messages. (Default: calculated min value: 1024)"
),
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_mcpm_receive,
cmd_manager_enable_mcmp_receive_deprecated,
NULL,
OR_ALL,
"EnableMCPMReceive - Allow the VirtualHost to receive MCPM."
"EnableMCPMReceive - Deprecated misspelled version of 'EnableMCMPReceive' configuration option kept for configuration backwards compatibility."
),
AP_INIT_NO_ARGS(
"EnableWsTunnel",
Expand Down Expand Up @@ -3660,7 +3675,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 @@ -3750,10 +3765,10 @@ static void *merge_manager_server_config(apr_pool_t *p, void *server1_conf,
else if (mconf1->reduce_display != 0)
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)
mconf->enable_ws_tunnel = mconf2->enable_ws_tunnel;
Expand Down
Loading