Skip to content

Conversation

@shugo
Copy link
Member

@shugo shugo commented Dec 15, 2023

Suggested by @ioquatix in #24 (comment)

Copy link
Contributor

@jeremyevans jeremyevans left a comment

Choose a reason for hiding this comment

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

I reviewed the related code, and it doesn't yield or appear to pass control to user code, so non-local flow control should not be a consideration, and this approach should be fine.

def transfercmd(cmd, rest_offset = nil) # :nodoc:
if @passive
host, port = makepasv
succeeded = false
Copy link
Contributor

Choose a reason for hiding this comment

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

This line is not actually needed. However, I have no problem with it if you using it to be explicit.

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks for your comment.

I'd like to initialize succeeded to clarify the intention.

Copy link
Member

@ioquatix ioquatix left a comment

Choose a reason for hiding this comment

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

LGTM. It's interesting that a trivial fix was actually non-trivial.

@shugo shugo merged commit 6be2f7e into master Dec 15, 2023
@shugo shugo deleted the fix-connection-leak-when-thread-interrupted branch December 15, 2023 03:47
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.

4 participants