Skip to content

Commit 0f059ea

Browse files
authored
Merge pull request #2117 from slingamn/handlepanic
add panic handler to async client/channel writes
2 parents 1d8bbde + dfe2a21 commit 0f059ea

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

irc/channel.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,8 @@ func (channel *Channel) wakeWriter() {
222222

223223
// equivalent of Socket.send()
224224
func (channel *Channel) writeLoop() {
225+
defer channel.server.HandlePanic()
226+
225227
for {
226228
// TODO(#357) check the error value of this and implement timed backoff
227229
channel.performWrite(0)

irc/client.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1773,6 +1773,8 @@ func (client *Client) wakeWriter() {
17731773
}
17741774

17751775
func (client *Client) writeLoop() {
1776+
defer client.server.HandlePanic()
1777+
17761778
for {
17771779
client.performWrite(0)
17781780
client.writebackLock.Unlock()

0 commit comments

Comments
 (0)