diff --git a/sftpd/sftpd_test.go b/sftpd/sftpd_test.go index 7d0dfc2b..f992c6f7 100644 --- a/sftpd/sftpd_test.go +++ b/sftpd/sftpd_test.go @@ -2003,8 +2003,6 @@ func TestSCPErrors(t *testing.T) { t.Skip("scp command not found, unable to execute this test") } u := getTestUser(true) - u.UploadBandwidth = 4096 - u.DownloadBandwidth = 4096 user, _, err := api.AddUser(u, http.StatusOK) if err != nil { t.Errorf("unable to add user: %v", err) @@ -2023,6 +2021,12 @@ func TestSCPErrors(t *testing.T) { if err != nil { t.Errorf("error uploading file via scp: %v", err) } + user.UploadBandwidth = 512 + user.DownloadBandwidth = 512 + _, _, err = api.UpdateUser(user, http.StatusOK) + if err != nil { + t.Errorf("unable to update user: %v", err) + } cmd := getScpDownloadCommand(localPath, remoteDownPath, false, false) go func() { if cmd.Run() == nil { diff --git a/sftpd/transfer.go b/sftpd/transfer.go index a3ae95a6..87e22a60 100644 --- a/sftpd/transfer.go +++ b/sftpd/transfer.go @@ -40,7 +40,7 @@ type Transfer struct { // For example network or client issues func (t *Transfer) TransferError(err error) { t.transferError = err - logger.Warn(logSender, t.connectionID, "Unexpected error for transfer, path: %#v, error: %#v bytes sent: %v, "+ + logger.Warn(logSender, t.connectionID, "Unexpected error for transfer, path: %#v, error: \"%v\" bytes sent: %v, "+ "bytes received: %v", t.path, t.transferError, t.bytesSent, t.bytesReceived) }