mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2025-02-19 15:30:17 +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) {
|
func (bc *BufferedConn) Read(p []byte) (int, error) {
|
||||||
startTime := time.Now()
|
startTime := time.Now()
|
||||||
n, err := bc.br.Read(p)
|
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)
|
err = fmt.Errorf("cannot read data in %.3f seconds: %w", time.Since(startTime).Seconds(), err)
|
||||||
}
|
}
|
||||||
return n, err
|
return n, err
|
||||||
|
|
Loading…
Reference in a new issue