1
0
espelhamento de https://bitbucket.org/s_l_teichmann/mtsatellite sincronizado 2025-07-03 00:20:48 +02:00

Dont log errors if client closes connections.

Esse commit está contido em:
Sascha L. Teichmann
2014-08-04 15:18:32 +02:00
commit 61cc35fda8
2 arquivos alterados com 5 adições e 1 exclusões

Ver arquivo

@ -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) {

Ver arquivo

@ -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")