aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--hotline/file_path.go1
-rw-r--r--hotline/server.go6
-rw-r--r--hotline/transaction_handlers.go3
3 files changed, 7 insertions, 3 deletions
diff --git a/hotline/file_path.go b/hotline/file_path.go
index c8fe652..c7e1574 100644
--- a/hotline/file_path.go
+++ b/hotline/file_path.go
@@ -94,7 +94,6 @@ func readPath(fileRoot string, filePath, fileName []byte) (fullPath string, err
}
fullPath = filepath.Join(
- "/",
fileRoot,
fp.String(),
filepath.Join("/", string(fileName)),
diff --git a/hotline/server.go b/hotline/server.go
index 9ffd272..ba0a668 100644
--- a/hotline/server.go
+++ b/hotline/server.go
@@ -808,8 +808,6 @@ func (s *Server) handleFileTransfer(ctx context.Context, rwc io.ReadWriter) erro
return err
}
- defer func() { _ = file.Close() }()
-
s.Logger.Infow("File upload started", "transactionRef", fileTransfer.ReferenceNumber, "dstFile", destinationFile)
rForkWriter := io.Discard
@@ -830,6 +828,10 @@ func (s *Server) handleFileTransfer(ctx context.Context, rwc io.ReadWriter) erro
return err
}
+ if err := file.Close(); err != nil {
+ return err
+ }
+
if err := s.FS.Rename(destinationFile+".incomplete", destinationFile); err != nil {
return err
}
diff --git a/hotline/transaction_handlers.go b/hotline/transaction_handlers.go
index c3b8c59..f080047 100644
--- a/hotline/transaction_handlers.go
+++ b/hotline/transaction_handlers.go
@@ -5,6 +5,7 @@ import (
"encoding/binary"
"errors"
"fmt"
+ "github.com/davecgh/go-spew/spew"
"gopkg.in/yaml.v3"
"io/ioutil"
"math/big"
@@ -1658,6 +1659,8 @@ func HandleGetFileNameList(cc *ClientConn, t *Transaction) (res []Transaction, e
return res, err
}
+ spew.Dump(fullPath)
+
var fp FilePath
if t.GetField(fieldFilePath).Data != nil {
if err = fp.UnmarshalBinary(t.GetField(fieldFilePath).Data); err != nil {