TSG-935 当 disable kafka log 时,不再解析 broker_list

This commit is contained in:
luwenpeng
2020-03-09 16:56:39 +08:00
parent 8079c4142f
commit b18cc3928c

View File

@@ -38,11 +38,14 @@ int ssl_mid_cert_kafka_logger_create(const char *profile, const char *section)
MESA_load_profile_int_def(profile, section, "mc_cache_enable", &enable, 0);
MESA_load_profile_string_def(profile, section, "mc_cache_eth", nic_name, sizeof(nic_name), "eth0");
MESA_load_profile_string_def(profile, section, "mc_cache_topic", topic_name, sizeof(topic_name), "PXY-EXCH-INTERMEDIA-CERT");
if (!enable) // is disableskip broker list
goto skip;
if (MESA_load_profile_string_def(profile, section, "mc_cache_broker_list", broker_list, sizeof(broker_list), NULL) < 0)
{
TFE_LOG_ERROR(g_default_logger, "%s, Fail to get mc_cache_broker_list in profile %s section %s.", errstr, profile, section);
return -1;
}
skip:
g_kafka_logger = tfe_kafka_logger_create(enable, nic_name, broker_list, topic_name, g_default_logger);
if (g_kafka_logger)
return 0;