Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
tg
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
tg
Commits
fd4780b8
Commit
fd4780b8
authored
Jan 27, 2014
by
Vysheng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
maybe fixed conn restart
parent
96b47dad
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
0 deletions
+5
-0
net.c
net.c
+4
-0
net.h
net.h
+1
-0
No files found.
net.c
View file @
fd4780b8
...
...
@@ -66,6 +66,7 @@ int ping_alarm (struct connection *c) {
if
(
verbosity
>
2
)
{
logprintf
(
"ping alarm
\n
"
);
}
assert
(
c
->
state
==
conn_ready
||
c
->
state
==
conn_connecting
);
if
(
get_double_time
()
-
c
->
last_receive_time
>
20
*
PING_TIMEOUT
)
{
if
(
verbosity
)
{
logprintf
(
"fail connection: reason: ping timeout
\n
"
);
...
...
@@ -97,10 +98,13 @@ void start_ping_timer (struct connection *c) {
void
restart_connection
(
struct
connection
*
c
);
int
fail_alarm
(
void
*
ev
)
{
((
struct
connection
*
)
ev
)
->
in_fail_timer
=
0
;
restart_connection
(
ev
);
return
0
;
}
void
start_fail_timer
(
struct
connection
*
c
)
{
if
(
c
->
in_fail_timer
)
{
return
;
}
c
->
in_fail_timer
=
1
;
c
->
ev
.
timeout
=
get_double_time
()
+
10
;
c
->
ev
.
alarm
=
(
void
*
)
fail_alarm
;
c
->
ev
.
self
=
c
;
...
...
net.h
View file @
fd4780b8
...
...
@@ -124,6 +124,7 @@ struct connection {
int
packet_num
;
int
out_packet_num
;
int
last_connect_time
;
int
in_fail_timer
;
struct
connection_methods
*
methods
;
struct
session
*
session
;
void
*
extra
;
...
...
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