mirror of
https://github.com/therealpaulgg/ssh-sync-server.git
synced 2026-04-25 07:35:49 +03:00
[PR #18] [MERGED] Ignore client connection closing - simpler challenge response error handling #26
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/ssh-sync-server#26
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/therealpaulgg/ssh-sync-server/pull/18
Author: @therealpaulgg
Created: 3/22/2024
Status: ✅ Merged
Merged: 3/22/2024
Merged by: @therealpaulgg
Base:
main← Head:fixing-critical-bugs📝 Commits (1)
5b457adi has issues📊 Changes
2 files changed (+23 additions, -47 deletions)
View changed files
📝
docker-compose.yaml(+5 -5)📝
pkg/web/live/main.go(+18 -42)📄 Description
There were significant oversights in the pull request #17.
While this code provided a great way of determining if the client indeed killed their session, there was a significant issue that arose, where this goroutine would read the first byte from the connection, causing any other readers which relied on this byte to effectively break themselves.
This code has been greatly simplified to, on the challenge responder side, simply check to see if we are receiving data from the channel (the channel closes, returning nil bytes). This was previously assuming any data obtained from the channel was in fact a byte array, which was false.
This code also resolves another bug, in which there was a goroutine reading from a channel from which the main thread was reading. While this code went unnoticed for a while, it was the cause of earlier panic issues (which were later obscured by concurrency bug fixes). The main channel always wins the race condition; but if it were to lose, this would result in a deadlock. The code has been simplified to have a channel created on the main thread, which the goroutine responds to either the timer expires or there is a message received from the Challenge Accepted channel (which other goroutines write to).
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.