mirror of
https://github.com/eclipse-mosquitto/mosquitto.git
synced 2026-02-06 02:52:07 +08:00
Fix option name.
This commit is contained in:
@@ -823,16 +823,16 @@ static int config__read_file_core(struct mosquitto__config *config, bool reload,
|
||||
}
|
||||
token = strtok_r((*buf), " ", &saveptr);
|
||||
if(token){
|
||||
if(!strcmp(token, "accept_protocol_version")){
|
||||
if(!strcmp(token, "accept_protocol_versions")){
|
||||
if(cur_listener == &config->default_listener){
|
||||
log__printf(NULL, MOSQ_LOG_ERR, "Error: You must define a listener before using the %s option.", "accept_protocol_version");
|
||||
log__printf(NULL, MOSQ_LOG_ERR, "Error: You must define a listener before using the %s option.", "accept_protocol_versions");
|
||||
return MOSQ_ERR_INVAL;
|
||||
}
|
||||
cur_listener->disable_protocol_v3 = true;
|
||||
cur_listener->disable_protocol_v4 = true;
|
||||
cur_listener->disable_protocol_v5 = true;
|
||||
if(saveptr == NULL){
|
||||
log__printf(NULL, MOSQ_LOG_ERR, "Error: Empty %s value in configuration.", "accept_protocol_version");
|
||||
log__printf(NULL, MOSQ_LOG_ERR, "Error: Empty %s value in configuration.", "accept_protocol_versions");
|
||||
return MOSQ_ERR_INVAL;
|
||||
}
|
||||
token = strtok_r(saveptr, ", \t", &saveptr);
|
||||
|
||||
@@ -8,7 +8,7 @@ def write_config(filename, port, accept):
|
||||
with open(filename, 'w') as f:
|
||||
f.write("listener %s\n" % (port))
|
||||
f.write("allow_anonymous true\n")
|
||||
f.write("accept_protocol_version %s\n" % (accept))
|
||||
f.write("accept_protocol_versions %s\n" % (accept))
|
||||
|
||||
def do_test(accept, expect_success):
|
||||
port = mosq_test.get_port()
|
||||
|
||||
Reference in New Issue
Block a user