mirror of
https://github.com/ergochat/ergo.git
synced 2024-12-23 11:12:44 +01:00
socket: Better deal with chanfloods
This commit is contained in:
parent
aad1070633
commit
91fab3ba55
@ -160,6 +160,8 @@ func (socket *Socket) RunSocketWriter() {
|
|||||||
socket.linesToSend = []string{}
|
socket.linesToSend = []string{}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
socket.linesToSendMutex.Unlock()
|
||||||
|
|
||||||
// write data
|
// write data
|
||||||
if 0 < len(data) {
|
if 0 < len(data) {
|
||||||
_, err := socket.conn.Write([]byte(data))
|
_, err := socket.conn.Write([]byte(data))
|
||||||
@ -172,11 +174,8 @@ func (socket *Socket) RunSocketWriter() {
|
|||||||
|
|
||||||
// check if we're closed
|
// check if we're closed
|
||||||
if socket.Closed {
|
if socket.Closed {
|
||||||
socket.linesToSendMutex.Unlock()
|
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|
||||||
socket.linesToSendMutex.Unlock()
|
|
||||||
}
|
}
|
||||||
if errOut {
|
if errOut {
|
||||||
// error out, bad stuff happened
|
// error out, bad stuff happened
|
||||||
|
Loading…
Reference in New Issue
Block a user