Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
G
gdut-drcom
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nanahira
gdut-drcom
Commits
7347faef
Commit
7347faef
authored
Dec 06, 2016
by
chenhaowen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add: exit_auth api
parent
e2a0423b
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
14 additions
and
1 deletion
+14
-1
src/auth.c
src/auth.c
+11
-1
src/auth.h
src/auth.h
+1
-0
src/config.c
src/config.c
+1
-0
src/config.h
src/config.h
+1
-0
No files found.
src/auth.c
View file @
7347faef
...
...
@@ -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
;
...
...
src/auth.h
View file @
7347faef
...
...
@@ -2,5 +2,6 @@
#define __AUTH_H__
int
auth
(
void
);
int
exit_auth
(
void
);
#endif //__AUTH_H__
src/config.c
View file @
7347faef
...
...
@@ -13,6 +13,7 @@ struct option_s {
/* extern variables */
struct
config_s
drcom_config
=
{
.
remote_port
=
61440
,
.
exit
=
0
,
};
/* extern variables */
...
...
src/config.h
View file @
7347faef
...
...
@@ -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
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment