diff options
| author | yw <[email protected]> | 2018-07-16 16:36:23 +0800 |
|---|---|---|
| committer | yw <[email protected]> | 2018-07-16 16:36:41 +0800 |
| commit | 22fe6e8ac773fea0fc4b35c67a1287909be42393 (patch) | |
| tree | 0c23d3f9b7cca01fd4c78a6b94ad9a102b64a7fd | |
| parent | fe66a9d8910c70d691866e346c1c26ff0db4a44e (diff) | |
return -1 when load profile error
| -rw-r--r-- | src/ntc_ssl_collect.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/ntc_ssl_collect.c b/src/ntc_ssl_collect.c index 618d01a..e47ce30 100644 --- a/src/ntc_ssl_collect.c +++ b/src/ntc_ssl_collect.c @@ -275,7 +275,7 @@ extern "C" UCHAR ntc_ssl_collect_entry(stSessionInfo *session_info, void **param return ret ; } -void ntc_ssl_collect_load_profile() +int ntc_ssl_collect_load_profile() { MESA_load_profile_string_def(PROFILE_PATH, PLUGIN_NAME, "log_path", g_ssl_collect_item.log_path, sizeof(g_ssl_collect_item.log_path), "./ntclog/ip_comm_log"); MESA_load_profile_uint_def(PROFILE_PATH,PLUGIN_NAME, "log_level", &g_ssl_collect_item.log_level, 30); @@ -286,14 +286,14 @@ void ntc_ssl_collect_load_profile() if(g_ssl_collect_item.local_ip_nr==INADDR_NONE) { printf("get_ip_by_eth_name in %s return NULL, exit!\n", nic_name); - exit(0); + return -1; } inet_ntop(AF_INET,&(g_ssl_collect_item.local_ip_nr),g_ssl_collect_item.local_ip_str,sizeof(g_ssl_collect_item.local_ip_str)); MESA_load_profile_int_def(PROFILE_PATH,"SYSTEM", "ENTRANCE_ID",&(g_ssl_collect_item.entry_id),0); MESA_load_profile_int_def(PROFILE_PATH,PLUGIN_NAME, "service", &g_ssl_collect_item.service, 0); MESA_load_profile_string_def(PROFILE_PATH, PLUGIN_NAME, "dpkt_label", g_ssl_collect_item.dpkt_label, sizeof(g_ssl_collect_item.dpkt_label), "DPKT_PROJECT"); - return ; + return 0; } int ntc_ssl_collect_kaka_init() @@ -327,7 +327,10 @@ int ntc_ssl_collect_kaka_init() extern "C" int ntc_ssl_collect_init() { memset(&g_ssl_collect_item, 0, sizeof(g_ssl_collect_item)); - ntc_ssl_collect_load_profile(); + if(0 != ntc_ssl_collect_load_profile()) + { + return ERROR; + } g_ssl_collect_item.log_handle = MESA_create_runtime_log_handle(g_ssl_collect_item.log_path, g_ssl_collect_item.log_level); if(g_ssl_collect_item.log_handle == NULL) return ERROR; |
