Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
dms3
go-bitswap
Commits
d9488272
Commit
d9488272
authored
May 29, 2019
by
hannahhoward
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(sessions): consecutive ticks only when wants present
Don't count consecutive ticks if there are no active wants
parent
3104b2da
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
4 deletions
+6
-4
session/session.go
session/session.go
+6
-4
No files found.
session/session.go
View file @
d9488272
...
...
@@ -314,10 +314,12 @@ func (s *Session) handleCancel(keys []cid.Cid) {
func
(
s
*
Session
)
handleTick
(
ctx
context
.
Context
)
{
if
s
.
fetchcnt
==
s
.
lastFetchCount
{
s
.
consecutiveTicks
++
}
else
{
s
.
lastFetchCount
=
s
.
fetchcnt
if
len
(
s
.
liveWants
)
>
0
{
if
s
.
fetchcnt
==
s
.
lastFetchCount
{
s
.
consecutiveTicks
++
}
else
{
s
.
lastFetchCount
=
s
.
fetchcnt
}
}
live
:=
make
([]
cid
.
Cid
,
0
,
len
(
s
.
liveWants
))
...
...
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