Skip to content

Commit

Permalink
Merge branch 'main' into feat/mode-support
Browse files Browse the repository at this point in the history
  • Loading branch information
fclairamb committed Jun 2, 2024
2 parents fb455b1 + d2b3c25 commit 3880fc0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion driver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ func NewTestServerWithDriverAndLogger(t *testing.T, driver MainDriver, logger lo
})

go func() {
if err := server.Serve(); err != nil && errors.Is(err, io.EOF) {
if err := server.Serve(); err != nil && !errors.Is(err, io.EOF) {
server.Logger.Error("problem serving", "err", err)
}
}()
Expand Down
4 changes: 2 additions & 2 deletions handle_files.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ func (c *clientHandler) doFileTransfer(transferConn net.Conn, file io.ReadWriter
}

// for reads io.EOF isn't an error, for writes it must be considered an error
if written, errCopy := io.Copy(writer, reader); errCopy != nil && (errors.Is(errCopy, io.EOF) || write) {
if written, errCopy := io.Copy(writer, reader); errCopy != nil && (!errors.Is(errCopy, io.EOF) || write) {
err = errCopy
} else {
c.logger.Debug(
Expand Down Expand Up @@ -704,7 +704,7 @@ func (c *clientHandler) computeHashForFile(filePath string, algo HASHAlgo, start

_, err = io.CopyN(chosenHashAlgo, file, end-start)

if err != nil && errors.Is(err, io.EOF) {
if err != nil && !errors.Is(err, io.EOF) {
return "", newFileAccessError("couldn't read file", err)
}

Expand Down

0 comments on commit 3880fc0

Please sign in to comment.