Skip to content

Commit

Permalink
Merge pull request #2117 from slingamn/handlepanic
Browse files Browse the repository at this point in the history
add panic handler to async client/channel writes
  • Loading branch information
slingamn committed Jan 5, 2024
2 parents 1d8bbde + dfe2a21 commit 0f059ea
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions irc/channel.go
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,8 @@ func (channel *Channel) wakeWriter() {

// equivalent of Socket.send()
func (channel *Channel) writeLoop() {
defer channel.server.HandlePanic()

for {
// TODO(#357) check the error value of this and implement timed backoff
channel.performWrite(0)
Expand Down
2 changes: 2 additions & 0 deletions irc/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -1773,6 +1773,8 @@ func (client *Client) wakeWriter() {
}

func (client *Client) writeLoop() {
defer client.server.HandlePanic()

for {
client.performWrite(0)
client.writebackLock.Unlock()
Expand Down

0 comments on commit 0f059ea

Please sign in to comment.