Skip to content

Move accept logic to a goroutine so it becomes non-blocking#345

Merged
antoniomika merged 1 commit intomainfrom
am/non-blocking-accept
Apr 10, 2025
Merged

Move accept logic to a goroutine so it becomes non-blocking#345
antoniomika merged 1 commit intomainfrom
am/non-blocking-accept

Conversation

@antoniomika
Copy link
Copy Markdown
Owner

Move accept logic to a goroutine so it becomes non-blocking

@antoniomika antoniomika requested a review from Copilot April 10, 2025 16:56
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

Comments suppressed due to low confidence (1)

utils/state.go:192

  • [nitpick] The call to CopyBoth is now executed synchronously inside the goroutine. Please ensure that this blocking call does not hinder desired concurrent processing or overall performance.
CopyBoth(conn, cl)

}
if err != nil || pL.State.IPFilter.Blocked(clientRemote) {
cl.Close()
return pL.Accept()
Copy link

Copilot AI Apr 10, 2025

Choose a reason for hiding this comment

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

Replacing the loop 'continue' with a recursive call may risk a stack overflow in situations of repeated accept errors. Consider refactoring to a loop-based error recovery mechanism to ensure long-term stability.

Copilot uses AI. Check for mistakes.
@antoniomika antoniomika merged commit e29172c into main Apr 10, 2025
2 checks passed
@antoniomika antoniomika deleted the am/non-blocking-accept branch April 10, 2025 20:01
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