Commit 23350d10 authored by chenhaowen's avatar chenhaowen

fix: parse option enable crypt of config file

parent 65d02fc4
......@@ -90,6 +90,17 @@ static int parse_line(char *buf, int size)
{
sscanf(opt.value, "%02hhx", &drcom_config.keep_alive1_flag);
}
else if (strcmp(opt.key, "enable_crypt") == 0)
{
if (strcmp(opt.value, "1") == 0)
{
drcom_config.enable_crypt = 1;
}
else if (strcmp(opt.value, "0") == 0)
{
drcom_config.enable_crypt = 0;
}
}
/* else if(strcmp(opt.key, "keep_alive2_flag") == 0)
{
sscanf(opt.value, "%02hhx", &drcom_config.keep_alive2_flag);
......
#ifndef __CONFIG_H__
#define __CONFIG_H__
enum CRYPT_TYPE {
DISABLE_CRYPT=0,
ENABLE_CRYPT=1,
AUTO_CRYPT=2
};
struct config_s {
char remote_ip[20];
int remote_port;
......
remote_ip = 10.0.3.2
#remote_root = 61440 #leave as default
keep_alive1_flag = 2a
enable_crypt = 1
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment