diff --git a/irc/channel.go b/irc/channel.go index f8c6e5de..586d80d1 100644 --- a/irc/channel.go +++ b/irc/channel.go @@ -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) diff --git a/irc/client.go b/irc/client.go index 57eb1599..83464599 100644 --- a/irc/client.go +++ b/irc/client.go @@ -1773,6 +1773,8 @@ func (client *Client) wakeWriter() { } func (client *Client) writeLoop() { + defer client.server.HandlePanic() + for { client.performWrite(0) client.writebackLock.Unlock()