Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix: restore closing SMTP message on method exit#14496

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
dannykopping merged 2 commits intomainfromdk/smtp-close-fix
Aug 30, 2024

Conversation

dannykopping
Copy link
Contributor

Follow up of#14495

If we don't callmessage.Close() once the method exits, we could leak resources.
This restores thedefer, but conditionalizes it such that it will only callClose() if it hasn't already been called. If we don't do this, the SMTP lib will send a subsequent line to the server after an error response, which is invalid. It's not a trainsmash, but it's better to be defensive.

.                                            <--- initial Close()501 5.5.4 Rejected!.                                            <--- deferred Close()501 5.5.2 Bad command

Signed-off-by: Danny Kopping <danny@coder.com>
Signed-off-by: Danny Kopping <danny@coder.com>
@dannykoppingdannykopping merged commit0f414a0 intomainAug 30, 2024
27 checks passed
@dannykoppingdannykopping deleted the dk/smtp-close-fix branchAugust 30, 2024 11:03
@github-actionsgithub-actionsbot locked and limited conversation to collaboratorsAug 30, 2024
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.

Reviewers

@mafredrimafredrimafredri approved these changes

@johnstcnjohnstcnjohnstcn approved these changes

Assignees

@dannykoppingdannykopping

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

3 participants

@dannykopping@mafredri@johnstcn

[8]ページ先頭

©2009-2025 Movatter.jp