Commit 7347faef authored by chenhaowen's avatar chenhaowen

add: exit_auth api

parent e2a0423b
......@@ -73,6 +73,10 @@ static void print_as_hex(uint8_t *buf, int len);
int auth(void)
{
if (!drcom_config.log_file)
{
drcom_config.log_file = stdout;
}
#ifdef WIN32
WORD sockVersion = MAKEWORD(2,2);
WSADATA wsaData;
......@@ -150,7 +154,7 @@ HEART_BEAT_START:
kp1_cnt = 1;
kp2_cnt = 0;
srand((unsigned int)time(NULL));
while (1)
while ( !drcom_config.exit )
{
retry_cnt = 1;
while (1)
......@@ -317,6 +321,12 @@ HEART_BEAT_START:
return 0;
}
int exit_auth(void)
{
drcom_config.exit = 1;
return 0;
}
static void print_as_hex(uint8_t *buf, int len)
{
int i;
......
......@@ -2,5 +2,6 @@
#define __AUTH_H__
int auth(void);
int exit_auth(void);
#endif //__AUTH_H__
......@@ -13,6 +13,7 @@ struct option_s {
/* extern variables */
struct config_s drcom_config = {
.remote_port = 61440,
.exit = 0,
};
/* extern variables */
......
......@@ -15,6 +15,7 @@ struct config_s {
unsigned char keep_alive1_flag;
int enable_crypt;
FILE * log_file;
int exit;
};
extern struct config_s drcom_config;
......
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