socket: Better deal with chanfloods

This commit is contained in:
Daniel Oaks
2017-03-24 21:54:22 +10:00
parent aad1070633
commit 91fab3ba55
+2 -3
View File
@@ -160,6 +160,8 @@ func (socket *Socket) RunSocketWriter() {
socket.linesToSend = []string{}
}
socket.linesToSendMutex.Unlock()
// write data
if 0 < len(data) {
_, err := socket.conn.Write([]byte(data))
@@ -172,11 +174,8 @@ func (socket *Socket) RunSocketWriter() {
// check if we're closed
if socket.Closed {
socket.linesToSendMutex.Unlock()
break
}
socket.linesToSendMutex.Unlock()
}
if errOut {
// error out, bad stuff happened