mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-11-21 14:44:00 +00:00
lib/handshake: pass io.EOF unmodified to the caller for BufferedConn.Read, so it could properly detect the end of stream
This commit is contained in:
parent
10b2855949
commit
c85084b659
1 changed files with 1 additions and 1 deletions
|
@ -47,7 +47,7 @@ func newBufferedConn(c net.Conn, compressionLevel int, isReadCompressed bool) *B
|
|||
func (bc *BufferedConn) Read(p []byte) (int, error) {
|
||||
startTime := time.Now()
|
||||
n, err := bc.br.Read(p)
|
||||
if err != nil {
|
||||
if err != nil && err != io.EOF {
|
||||
err = fmt.Errorf("cannot read data in %.3f seconds: %w", time.Since(startTime).Seconds(), err)
|
||||
}
|
||||
return n, err
|
||||
|
|
Loading…
Reference in a new issue