Skip to content

minecraft/listener.go: Fix panic when listener closes during login - #533

Open
THEBOSS9345 wants to merge 1 commit into
Sandertv:masterfrom
THEBOSS9345:fix-listener-closed-channel
Open

THEBOSS9345 wants to merge 1 commit into
Sandertv:masterfrom
THEBOSS9345:fix-listener-closed-channel

Conversation

@THEBOSS9345

Copy link
Copy Markdown

my server crashed with send on closed channel in listener.go when the listener closes while a player is logging in. listen closes incoming while handleConn can still send to it. i stopped closing incoming and made Accept wait on close instead. tested on my server.

…ener closes

listen closed listener.incoming on exit, while handleConn could still be selecting on a send to it for a connection that just logged in. When both listener.close and listener.incoming were closed, select could pick the send and panic. incoming is no longer closed, and Accept waits on listener.close instead.
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.

1 participant