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

fix: unlock recvLock in all cases. #25

Merged
merged 1 commit into from
Apr 20, 2020
Merged

fix: unlock recvLock in all cases. #25

merged 1 commit into from
Apr 20, 2020

Conversation

Stebalien
Copy link
Member

Otherwise, we could block on a call to stream.Read forever.

Otherwise, we could block on a call to stream.Read forever.
// 1. We don't accept a message that's too big.
// 2. We unlock after resetting the stream.
for i := uint32(1); i < 100; i += 2 {
func() {
Copy link
Contributor

Choose a reason for hiding this comment

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

the anonymous function is just to set the scope for the defers? can probably be removed and the closes put at bottom of the loop

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm trying to avoid leaking anything, even on fatal errors.

@Stebalien Stebalien merged commit 29a0d6e into master Apr 20, 2020
@Stebalien Stebalien mentioned this pull request May 26, 2020
77 tasks
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.

2 participants