Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Always stop timer in Stream.Read #53

Merged
merged 1 commit into from
Jul 10, 2019
Merged

Always stop timer in Stream.Read #53

merged 1 commit into from
Jul 10, 2019

Conversation

joesis
Copy link
Contributor

@joesis joesis commented Jul 10, 2019

Resolves #52

@codecov-io
Copy link

codecov-io commented Jul 10, 2019

Codecov Report

Merging #53 into master will decrease coverage by 0.21%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #53      +/-   ##
==========================================
- Coverage   84.68%   84.46%   -0.22%     
==========================================
  Files           5        5              
  Lines         470      470              
==========================================
- Hits          398      397       -1     
- Misses         62       64       +2     
+ Partials       10        9       -1
Impacted Files Coverage Δ
stream.go 89.55% <100%> (+1.49%) ⬆️
session.go 78.62% <0%> (-1.15%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 79b3c96...e7738d0. Read the comment docs.

deadline = timer.C
}

select {
case <-s.chReadEvent:
if timer != nil {
timer.Stop()
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When chReadEvent is got, the next iteration would read something and exit the for loop, hence stopping the timer.

joesis added a commit to getlantern/flashlight that referenced this pull request Jul 10, 2019
@xtaci xtaci merged commit 67e00e8 into xtaci:master Jul 10, 2019
forkner added a commit to getlantern/flashlight that referenced this pull request Jul 10, 2019
@joesis joesis deleted the smux-issue-52 branch July 11, 2019 00:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Not cleaned timer caused exceesive memory usage
3 participants