}
}
+ defer file.Close()
+
f, err := NewFileWrapper(fileStore, fullPath, 0)
if err != nil {
return err
}
- rLogger.Info("File upload started", "dstFile", fullPath)
+ rLogger.Debug("File upload started", "dstFile", fullPath)
rForkWriter := io.Discard
iForkWriter := io.Discard
}
if err := receiveFile(rwc, file, rForkWriter, iForkWriter, fileTransfer.bytesSentCounter); err != nil {
- rLogger.Error(err.Error())
- }
-
- if err := file.Close(); err != nil {
- return err
+ return fmt.Errorf("receive file: %v", err)
}
if err := fileStore.Rename(fullPath+".incomplete", fullPath); err != nil {
- return err
+ return fmt.Errorf("rename incomplete file: %v", err)
}
rLogger.Info("File upload complete", "dstFile", fullPath)
}
subPath := path[basePathLen+1:]
- rLogger.Debug("Sending fileheader", "i", i, "path", path, "fullFilePath", fullPath, "subPath", subPath, "IsDir", info.IsDir())
if i == 1 {
return nil
return err
}
- rLogger.Debug("Client folder download action", "action", fmt.Sprintf("%X", nextAction[0:2]))
-
var dataOffset int64
switch nextAction[1] {