瀏覽代碼

socket: Better deal with chanfloods

tags/v0.7.0
Daniel Oaks 7 年之前
父節點
當前提交
91fab3ba55
共有 1 個檔案被更改,包括 2 行新增3 行删除
  1. 2
    3
      irc/socket.go

+ 2
- 3
irc/socket.go 查看文件

160
 				socket.linesToSend = []string{}
160
 				socket.linesToSend = []string{}
161
 			}
161
 			}
162
 
162
 
163
+			socket.linesToSendMutex.Unlock()
164
+
163
 			// write data
165
 			// write data
164
 			if 0 < len(data) {
166
 			if 0 < len(data) {
165
 				_, err := socket.conn.Write([]byte(data))
167
 				_, err := socket.conn.Write([]byte(data))
172
 
174
 
173
 			// check if we're closed
175
 			// check if we're closed
174
 			if socket.Closed {
176
 			if socket.Closed {
175
-				socket.linesToSendMutex.Unlock()
176
 				break
177
 				break
177
 			}
178
 			}
178
-
179
-			socket.linesToSendMutex.Unlock()
180
 		}
179
 		}
181
 		if errOut {
180
 		if errOut {
182
 			// error out, bad stuff happened
181
 			// error out, bad stuff happened

Loading…
取消
儲存