From c7ecf014275efdf7650edf1c560520e89880a247 Mon Sep 17 00:00:00 2001 From: luqiuwen Date: Sat, 22 Jun 2019 21:03:33 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=91=BD=E4=BB=A4=E8=A1=8C?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E7=89=88=E6=9C=AC=E5=8F=B7=E7=9A=84=E5=8A=9F?= =?UTF-8?q?=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- platform/src/proxy.cpp | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/platform/src/proxy.cpp b/platform/src/proxy.cpp index d623291..7f9b136 100644 --- a/platform/src/proxy.cpp +++ b/platform/src/proxy.cpp @@ -14,6 +14,7 @@ #include #include #include +#include #include #include @@ -379,7 +380,21 @@ int main(int argc, char * argv[]) const char * main_profile = "./conf/tfe/tfe.conf"; const char * future_profile= "./conf/tfe/future.conf"; - /* adds locking, only required if accessed from separate threads */ + int ret = 0; + int opt = 0; + while ((opt = getopt(argc, argv, "v")) != -1) + { + switch (opt) + { + case 'v': + fprintf(stderr, "Tango Frontend Engine, Version: %s\n", tfe_version()); + return 0; + default: + break; + } + } + + /* adds locking, only required if accessed from separate threads */ evthread_use_pthreads(); unsigned int __log_level = RLOG_LV_INFO; @@ -402,8 +417,9 @@ int main(int argc, char * argv[]) g_default_proxy = ALLOC(struct tfe_proxy, 1); assert(g_default_proxy); strcpy(g_default_proxy->name, "tfe3a"); + /* CONFIG */ - int ret = tfe_proxy_config(g_default_proxy, main_profile); + ret = tfe_proxy_config(g_default_proxy, main_profile); CHECK_OR_EXIT(ret == 0, "Failed at loading profile %s, Exit.", main_profile); /* PERFOMANCE MONITOR */