Skip to content

Commit

Permalink
in_forward: Address review comments
Browse files Browse the repository at this point in the history
Signed-off-by: Hiroshi Hatake <[email protected]>
  • Loading branch information
cosmo0920 committed Dec 6, 2024
1 parent 48d52cc commit fcda579
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 16 deletions.
2 changes: 1 addition & 1 deletion plugins/in_forward/fw.c
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@ static struct flb_config_map config_map[] = {
},
{
FLB_CONFIG_MAP_STR, "shared_key", NULL,
0, FLB_FALSE, 0,
0, FLB_TRUE, offsetof(struct flb_in_fw_config, shared_key),
"Shared key for authentication"
},
{
Expand Down
18 changes: 3 additions & 15 deletions plugins/in_forward/fw_config.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,24 +86,12 @@ struct flb_in_fw_config *fw_config_init(struct flb_input_instance *i_ins)
}

/* Shared Key */
p = flb_input_get_property("empty_shared_key", i_ins);
if (p && flb_utils_bool(p)) {
config->empty_shared_key = FLB_TRUE;
}
else {
config->empty_shared_key = FLB_FALSE;
}

p = flb_input_get_property("shared_key", i_ins);
if (config->empty_shared_key) {
if (config->shared_key) {
flb_sds_destroy(config->shared_key);
}
config->shared_key = flb_sds_create("");
}
else if (p) {
config->shared_key = flb_sds_create(p);
}
else {
config->shared_key = NULL;
}

/* Self Hostname */
p = flb_input_get_property("self_hostname", i_ins);
Expand Down

0 comments on commit fcda579

Please sign in to comment.