mirror of
https://github.com/zrepl/zrepl.git
synced 2025-01-23 22:58:54 +01:00
20 lines
372 B
Go
20 lines
372 B
Go
|
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))
|
||
|
}
|