增加命令行查询版本号的功能
This commit is contained in:
@@ -14,6 +14,7 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <pthread.h>
|
#include <pthread.h>
|
||||||
|
#include <getopt.h>
|
||||||
|
|
||||||
#include <event2/event.h>
|
#include <event2/event.h>
|
||||||
#include <event2/dns.h>
|
#include <event2/dns.h>
|
||||||
@@ -379,6 +380,20 @@ int main(int argc, char * argv[])
|
|||||||
const char * main_profile = "./conf/tfe/tfe.conf";
|
const char * main_profile = "./conf/tfe/tfe.conf";
|
||||||
const char * future_profile= "./conf/tfe/future.conf";
|
const char * future_profile= "./conf/tfe/future.conf";
|
||||||
|
|
||||||
|
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 */
|
/* adds locking, only required if accessed from separate threads */
|
||||||
evthread_use_pthreads();
|
evthread_use_pthreads();
|
||||||
|
|
||||||
@@ -402,8 +417,9 @@ int main(int argc, char * argv[])
|
|||||||
g_default_proxy = ALLOC(struct tfe_proxy, 1);
|
g_default_proxy = ALLOC(struct tfe_proxy, 1);
|
||||||
assert(g_default_proxy);
|
assert(g_default_proxy);
|
||||||
strcpy(g_default_proxy->name, "tfe3a");
|
strcpy(g_default_proxy->name, "tfe3a");
|
||||||
|
|
||||||
/* CONFIG */
|
/* 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);
|
CHECK_OR_EXIT(ret == 0, "Failed at loading profile %s, Exit.", main_profile);
|
||||||
|
|
||||||
/* PERFOMANCE MONITOR */
|
/* PERFOMANCE MONITOR */
|
||||||
|
|||||||
Reference in New Issue
Block a user