diff options
| author | 刘学利 <[email protected]> | 2020-09-18 12:12:57 +0800 |
|---|---|---|
| committer | 刘学利 <[email protected]> | 2020-09-18 12:12:57 +0800 |
| commit | aafcea896fb967a4fce5785f8c42bf1117a4863e (patch) | |
| tree | 491fcb23c1c5548e6e574601a157de0fb3fb4b80 /src | |
| parent | 2e50b5347fcceda99afd263b4996a4813841c5d2 (diff) | |
Fix log level
Diffstat (limited to 'src')
| -rw-r--r-- | src/CMakeLists.txt | 4 | ||||
| -rw-r--r-- | src/fw_dns_plug.cpp | 13 |
2 files changed, 13 insertions, 4 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 6d90e4b..8edc88f 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -8,12 +8,12 @@ include_directories(${CMAKE_SOURCE_DIR}/src) include_directories(/opt/MESA/include/) include_directories(/opt/MESA/include/tsg/) -set(FW_DNS_PLUG_DEPEND_DYN_LIB MESA_handle_logger MESA_prof_load maatframe pthread MESA_field_stat2) +set(FW_DNS_PLUG_DEPEND_DYN_LIB maatframe pthread MESA_field_stat2) add_library(fw_dns_plug SHARED ${SRC}) target_link_libraries(fw_dns_plug ${FW_DNS_PLUG_DEPEND_DYN_LIB}) set_target_properties(fw_dns_plug PROPERTIES PREFIX "") -install(TARGETS fw_dns_plug LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}/plug/business/fw_dns_plug COMPONENT LIBRARY) +install(TARGETS fw_dns_plug LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}/plug/business/fw_dns_plug COMPONENT LIBRARIES) install(FILES ../bin/fw_dns_plug.inf DESTINATION ${CMAKE_INSTALL_PREFIX}/plug/business/fw_dns_plug COMPONENT PROFILE) diff --git a/src/fw_dns_plug.cpp b/src/fw_dns_plug.cpp index 2f51776..5ab4ab5 100644 --- a/src/fw_dns_plug.cpp +++ b/src/fw_dns_plug.cpp @@ -314,6 +314,10 @@ static int fw_dns_send_log(struct streaminfo *a_stream, dns_info_t *dns_info, st get_rr_str2json(object, dns_info, &dns_sec); rr_buf=cJSON_PrintUnformatted(object); TLD_append(handle, (char *)"dns_rr", (void *)rr_buf, TLD_TYPE_STRING); + + cJSON_Delete(object); + object=NULL; + free(rr_buf); rr_buf=NULL; @@ -338,10 +342,15 @@ extern "C" char FW_DNS_PLUG_ENTRY(stSessionInfo* session_info, void **pme, int struct Maat_rule_t result[MAX_RESULT_NUM], *p_result=NULL; dns_info_t *dns_info=(dns_info_t *)session_info->app_info; - if(dns_info==NULL || strlen((char *)dns_info->query_question.qname)==0) + if(dns_info==NULL) + { + return state; + } + + if(strlen((char *)dns_info->query_question.qname)==0) { MESA_handle_runtime_log(g_fw_dns_plug_info.logger, - RLOG_LV_FATAL, + RLOG_LV_DEBUG, "DNS_PLUG", "Qname is %s, addr: %s", (dns_info==NULL) ? "NULL" : ((strlen((char *)dns_info->query_question.qname)==0) ? "NULL" : (char *)dns_info->query_question.qname), |
