zrepl/rpc/dataconn/timeoutconn/timeoutconn_debug.go

20 lines
372 B
Go
Raw Normal View History

package timeoutconn
import (
"fmt"
"io"
)
const debugReadvNoShortReadsAssertEnable = false
func debugReadvNoShortReadsAssert(expectedLen, returnedLen int64, returnedErr error) {
readShort := expectedLen != returnedLen
if !readShort {
return
}
if returnedErr != io.EOF {
return
}
panic(fmt.Sprintf("ReadvFull short and error is not EOF%v\n", returnedErr))
}