parent
42795a7361
commit
5b74eb44e9
|
@ -43,14 +43,14 @@ LogLevel=All
|
|||
# This is http inerface for viewing lease status,
|
||||
# Default is 127.0.0.1:6789
|
||||
# You can change it here to any network interface.
|
||||
HTTPServer=192.168.30.1:6789
|
||||
#HTTPServer=192.168.30.1:6789
|
||||
# Also to limit the clients access, you can specify upto 8
|
||||
# HTTP client IPs Here. If no Client IP is specified then All
|
||||
# Clients can access the HTTP Interface
|
||||
HTTPClient=192.168.30.1
|
||||
HTTPClient=192.168.30.110
|
||||
HTTPClient=192.168.100.1
|
||||
HTTPClient=192.168.100.110
|
||||
#HTTPClient=192.168.30.1
|
||||
#HTTPClient=192.168.30.110
|
||||
#HTTPClient=192.168.100.1
|
||||
#HTTPClient=192.168.100.110
|
||||
;HTTPClient=192.168.23.123
|
||||
# You can also change the title of html page
|
||||
;HTTPTitle=This is Custom Title
|
||||
|
|
|
@ -6,8 +6,7 @@ include(ExternalProject)
|
|||
|
||||
INCLUDE_DIRECTORIES(include
|
||||
./ ./include ../lwip/src/include ../lwip/src/arch_linux/include ../include
|
||||
../httpserver/include ../httpserver/src/haywire ../httpserver/src/haywire/configuration
|
||||
${COMMON_INCLUDE})
|
||||
../httpserver/include ../httpserver/src/haywire ../httpserver/src/haywire/configuration)
|
||||
FILE(GLOB C_HEADS include/*.h include/uthash/*.h include/s2j/*.h vector/*.h)
|
||||
|
||||
AUX_SOURCE_DIRECTORY(json C_SRC)
|
||||
|
|
|
@ -83,7 +83,7 @@ const char *base64_encode(unsigned char *pSrc, unsigned int sLen) {
|
|||
return (NULL);
|
||||
}
|
||||
|
||||
size = ((sLen / 3) * 4) + 4 + (sLen / 64) + sLen % 64;
|
||||
size = (int)(((sLen / 3) * 4) + 4 + (sLen / 64) + sLen % 64);
|
||||
|
||||
pEncode = (char *)malloc(size);
|
||||
memset(pEncode, 0, size);
|
||||
|
@ -118,7 +118,7 @@ unsigned char *base64_decode(const char *pBase64, unsigned int *pOutSize) {
|
|||
return (NULL);
|
||||
}
|
||||
|
||||
size = strlen(pBase64);
|
||||
size = (int)strlen(pBase64);
|
||||
pDecode = (unsigned char *)malloc(size);
|
||||
memset(pDecode, 0, size);
|
||||
#if !defined(OPENSSL_VERSION_NUMBER) || OPENSSL_VERSION_NUMBER < 0x10100000L
|
||||
|
@ -126,7 +126,7 @@ unsigned char *base64_decode(const char *pBase64, unsigned int *pOutSize) {
|
|||
EVP_DecodeUpdate(&ctx, pDecode, &enSize, (const unsigned char *)pBase64, strlen(pBase64));
|
||||
#else
|
||||
EVP_DecodeInit(pCtx);
|
||||
EVP_DecodeUpdate(pCtx, pDecode, &enSize, (const unsigned char *)pBase64, strlen(pBase64));
|
||||
EVP_DecodeUpdate(pCtx, pDecode, &enSize, (const unsigned char *)pBase64, (int)strlen(pBase64));
|
||||
#endif
|
||||
if (pOutSize) {
|
||||
*pOutSize = enSize;
|
||||
|
|
|
@ -66,6 +66,7 @@ typedef enum {
|
|||
} CONFIG_ITEM_ID;
|
||||
|
||||
const char *get_cur_process_dir();
|
||||
const char*get_cur_process_name();
|
||||
|
||||
const char *config_get_ssl_ca_path();
|
||||
const char *cfg_get_config_directory();
|
||||
|
|
|
@ -72,7 +72,7 @@ int user_init(const char *pAppCfgFile, const char *pCfgDirectory, const char *pK
|
|||
utstring_new(pPath);
|
||||
utstring_printf(pPath, "%s/%s", bufCfgDir, "zlog.conf");
|
||||
|
||||
if ((ret = dzlog_init(utstring_body(pPath), "libagent")) != ERR_SUCCESS) {
|
||||
if ((ret = dzlog_init(utstring_body(pPath), get_cur_process_name())) != ERR_SUCCESS) {
|
||||
printf("Zlog configure file [%s] init result: %d+++++\n", utstring_body(pPath), ret);
|
||||
zlog_profile();
|
||||
return -ERR_ZLOG_INIT;
|
||||
|
@ -80,7 +80,8 @@ int user_init(const char *pAppCfgFile, const char *pCfgDirectory, const char *pK
|
|||
dzlog_info("Zlog used configure file [%s]\n", utstring_body(pPath));
|
||||
}
|
||||
|
||||
zlog_level_switch(zlog_get_category("libagent"), logLevel > ZLOG_LEVEL_DEBUG ? logLevel : ZLOG_LEVEL_DEBUG);
|
||||
zlog_level_switch(zlog_get_category(get_cur_process_name()),
|
||||
logLevel > ZLOG_LEVEL_DEBUG ? logLevel : ZLOG_LEVEL_DEBUG);
|
||||
|
||||
utstring_free(pPath);
|
||||
|
||||
|
|
|
@ -232,4 +232,15 @@ int get_nic_info(const char *pName, unsigned int *pIp, unsigned int *pNetmask, u
|
|||
|
||||
close(sock);
|
||||
return err;
|
||||
}
|
||||
|
||||
const char*get_cur_process_name() {
|
||||
static char g_exeName[1024];
|
||||
|
||||
memset(g_exeName, 0, 1024);
|
||||
if (readlink("/proc/self/exe", g_exeName, 1023) <= 0) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return basename_v2(g_exeName);
|
||||
}
|
|
@ -47,7 +47,6 @@ static void lwip_init_env() {
|
|||
|
||||
int main(int argc, char **argv) {
|
||||
int ret;
|
||||
hiredisResetAllocators();
|
||||
#ifdef OPENDHCPDDNS_ON
|
||||
return dual_server_main(argc, argv);
|
||||
#else
|
||||
|
|
Loading…
Reference in New Issue