diff --git a/common/src/tfe_types.cpp b/common/src/tfe_types.cpp index 636edc6..4c563c1 100644 --- a/common/src/tfe_types.cpp +++ b/common/src/tfe_types.cpp @@ -8,6 +8,7 @@ const char * tfe_stream_conn_dir_to_str(enum tfe_conn_dir dir) char * tfe_stream_addr_to_str(const struct tfe_stream_addr * addr) { char * __str_ret = NULL; + if(addr==NULL) return NULL; if (addr->addrtype == TFE_ADDR_STREAM_TUPLE4_V4) { const struct tfe_stream_addr_tuple4_v4 * tuple4_v4 = addr->tuple4_v4; diff --git a/conf/pangu/pangu_pxy.conf b/conf/pangu/pangu_pxy.conf index 8c099cd..f1fdeac 100644 --- a/conf/pangu/pangu_pxy.conf +++ b/conf/pangu/pangu_pxy.conf @@ -8,7 +8,7 @@ kafka_brokerlist=192.168.10.73:9092 [maat] # 0:json 1: redis 2: iris -maat_input_mode=0 +maat_input_mode=1 table_info=resource/pangu/table_info.conf json_cfg_file=resource/ stat_file=log/pangu_scan.status @@ -53,3 +53,6 @@ wiredlb_redis_health_port=52101 cache_undefined_obj=1 query_undefined_obj=0 +statsd_server=192.168.10.72 +statsd_port=8126 +histogram_bins=0.20,0.40,0.6,0.8 diff --git a/conf/tfe/tfe.conf b/conf/tfe/tfe.conf index c8688eb..f348747 100644 --- a/conf/tfe/tfe.conf +++ b/conf/tfe/tfe.conf @@ -4,9 +4,9 @@ uxdomain=/home/server_unixsocket_file ssl_max_version=tls12 no_session_ticket=0 log_master_key=1 -trusted_cert_file=./conf/tls-ca-bundle.pem -trusted_cert_dir=./conf/trusted_storage -key_log_file=./sslkeylog.log +trusted_cert_file=resource/tfe/tls-ca-bundle.pem +trusted_cert_dir=resource/tfe/trusted_storage +key_log_file=log/sslkeylog.log no_alpn=1 [key_keeper] @@ -15,8 +15,8 @@ no_alpn=1 mode = debug cert_store_host=192.168.11.100 cert_store_port=9991 -ca_path=conf/mesalab-ca.pem -untrusted_ca_path=conf/mesalab-ca-untrust.pem +ca_path=resource/tfe/mesalab-ca.pem +untrusted_ca_path=resource/tfe/mesalab-ca-untrust.pem [debug] passthrough_all_tcp=0 @@ -28,3 +28,10 @@ tcp_keepintvl=15 tcp_keepidle=30 tcp_user_timeout=30 +[log] +level=10 + +[stat] +statsd_server=192.168.10.72 +statsd_port=8126 +histogram_bins=0.50,0.80,0.9,0.95 diff --git a/platform/src/proxy.cpp b/platform/src/proxy.cpp index 2d29653..f5fd20f 100644 --- a/platform/src/proxy.cpp +++ b/platform/src/proxy.cpp @@ -279,8 +279,8 @@ int tfe_stat_init(struct tfe_proxy * proxy, const char * profile) int value = 0, i = 0; screen_stat_handle_t fs_handle = NULL; - char statsd_server_ip[TFE_SYMBOL_MAX]; - char histogram_bins[TFE_SYMBOL_MAX]; + char statsd_server_ip[TFE_SYMBOL_MAX]={0}; + char histogram_bins[TFE_SYMBOL_MAX]={0}; int statsd_server_port=0; MESA_load_profile_string_def(profile, "STAT", "statsd_server", statsd_server_ip, sizeof(statsd_server_ip), ""); diff --git a/platform/src/ssl_stream.cpp b/platform/src/ssl_stream.cpp index 0c932c2..ada692a 100644 --- a/platform/src/ssl_stream.cpp +++ b/platform/src/ssl_stream.cpp @@ -462,7 +462,7 @@ static void log_ssl_master_key(SSL* ssl, int fd, tfe_conn_dir dir, FILE* fp) struct tfe_stream_addr* addr=tfe_stream_addr_create_by_fd(fd, dir); char* addr_string=tfe_stream_addr_to_str(addr); - fprintf(fp, "#%s %s %s\n%s\n", time_str, tfe_stream_conn_dir_to_str(dir), addr_string, key_str); + fprintf(fp, "#%s %s %s\n%s\n", time_str, tfe_stream_conn_dir_to_str(dir), addr_string?addr_string:NULL, key_str); free(key_str); tfe_stream_addr_free(addr); diff --git a/plugin/business/pangu-http/src/pangu_web_cache.cpp b/plugin/business/pangu-http/src/pangu_web_cache.cpp index 7bffab2..50e720b 100644 --- a/plugin/business/pangu-http/src/pangu_web_cache.cpp +++ b/plugin/business/pangu-http/src/pangu_web_cache.cpp @@ -622,6 +622,10 @@ struct cache_handle* create_web_cache_handle(const char* profile_path, const cha struct cache_handle* cache=ALLOC(struct cache_handle, 1); int temp=0; struct event* ev=NULL; + char statsd_server_ip[TFE_SYMBOL_MAX]={0}; + char histogram_bins[TFE_SYMBOL_MAX]={0}; + int statsd_server_port=0; + cache->logger=logger; cache->thread_count=tfe_proxy_get_work_thread_count(); cache->clients=ALLOC(struct tango_cache_instance *, cache->thread_count); @@ -698,9 +702,6 @@ struct cache_handle* create_web_cache_handle(const char* profile_path, const cha 0, cache); cache->ref_feather=feather; } - char statsd_server_ip[TFE_SYMBOL_MAX]; - char histogram_bins[TFE_SYMBOL_MAX]; - int statsd_server_port=0; MESA_load_profile_string_def(profile_path, section, "statsd_server", statsd_server_ip, sizeof(statsd_server_ip), "");