mirror of
https://bitbucket.org/s_l_teichmann/mtsatellite
synced 2025-01-22 22:30:27 +01:00
Dont log errors if client closes connections.
This commit is contained in:
parent
7a98421645
commit
61cc35fda8
@ -39,6 +39,7 @@ func (c *Connection) Run() {
|
||||
r := bufio.NewReader(c.conn)
|
||||
parser := NewRedisParser(r, rce)
|
||||
parser.Parse()
|
||||
log.Println("client disconnected")
|
||||
}
|
||||
|
||||
func logError(err error) {
|
||||
|
@ -8,6 +8,7 @@ import (
|
||||
"bufio"
|
||||
"bytes"
|
||||
"fmt"
|
||||
"io"
|
||||
"log"
|
||||
"strconv"
|
||||
)
|
||||
@ -39,7 +40,9 @@ func (rp *RedisParser) Parse() {
|
||||
func (rp *RedisParser) nextLine() []byte {
|
||||
line, err := rp.reader.ReadBytes('\n')
|
||||
if err != nil {
|
||||
rp.consumer.ConsumeError(err)
|
||||
if err != io.EOF {
|
||||
rp.consumer.ConsumeError(err)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
return bytes.TrimRight(line, "\r\n")
|
||||
|
Loading…
Reference in New Issue
Block a user