Skip to content

fix: flush the closing reply (464/ERROR) before closing the socket - #59

Merged
numorb merged 1 commit into
mainfrom
fix/flush-before-close
Sep 22, 2026
Merged

numorb merged 1 commit into
mainfrom
fix/flush-before-close

Conversation

@numorb

@numorb numorb commented Sep 22, 2026

Copy link
Copy Markdown
Collaborator

Bug: flush the closing reply (464 / ERROR) before closing the socket. When the server closed a connection itself (wrong password during registration or QUIT), the closing reply was queued in the client's write buffer, but the socket was closed in the same poll() iteration, before poll() ever reported POLLOUT. So the client ended up not receiving 464 for a wrong password or "ERROR :Closing link" for QUIT. It just got eof. I wasn't sure whether this would be considered a fail, but from what I've been seeing and reading, it is very likely that it would. It was a very small fix, so I thought it made sense to add it and not risk it..

@numorb
numorb merged commit 3326ecd into main Sep 22, 2026
1 check passed
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.

3 participants