瀏覽代碼

add panic handler to async client/channel writes

See #2113 for motivation
tags/v2.13.0-rc1
Shivaram Lingamneni 4 月之前
父節點
當前提交
dfe2a21b17
共有 2 個檔案被更改,包括 4 行新增0 行删除
  1. 2
    0
      irc/channel.go
  2. 2
    0
      irc/client.go

+ 2
- 0
irc/channel.go 查看文件

@@ -222,6 +222,8 @@ func (channel *Channel) wakeWriter() {
222 222
 
223 223
 // equivalent of Socket.send()
224 224
 func (channel *Channel) writeLoop() {
225
+	defer channel.server.HandlePanic()
226
+
225 227
 	for {
226 228
 		// TODO(#357) check the error value of this and implement timed backoff
227 229
 		channel.performWrite(0)

+ 2
- 0
irc/client.go 查看文件

@@ -1773,6 +1773,8 @@ func (client *Client) wakeWriter() {
1773 1773
 }
1774 1774
 
1775 1775
 func (client *Client) writeLoop() {
1776
+	defer client.server.HandlePanic()
1777
+
1776 1778
 	for {
1777 1779
 		client.performWrite(0)
1778 1780
 		client.writebackLock.Unlock()

Loading…
取消
儲存