mirror of
https://github.com/schollz/croc.git
synced 2025-10-11 13:21:00 +02:00
hash the sent name
This commit is contained in:
parent
f9ed7553af
commit
80471c7d02
1 changed files with 2 additions and 2 deletions
|
@ -50,7 +50,7 @@ func send(c *websocket.Conn, fname string, codephrase string) (err error) {
|
|||
return err
|
||||
}
|
||||
// get stats
|
||||
fstats := models.FileStats{fstat.Name(), fstat.Size(), fstat.ModTime(), fstat.IsDir(), fstats.Name()}
|
||||
fstats := models.FileStats{fstat.Name(), fstat.Size(), fstat.ModTime(), fstat.IsDir(), fstat.Name()}
|
||||
if fstats.IsDir {
|
||||
// zip the directory
|
||||
fstats.SentName, err = zipper.ZipFile(fname, true)
|
||||
|
@ -165,7 +165,7 @@ func send(c *websocket.Conn, fname string, codephrase string) (err error) {
|
|||
|
||||
bar.Finish()
|
||||
log.Debug("send hash to finish file")
|
||||
fileHash, err := utils.HashFile(fname)
|
||||
fileHash, err := utils.HashFile(fstats.SentName)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue