Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev tming #288

Merged
merged 3 commits into from
Aug 27, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -837,28 +837,36 @@ func encodeSendFileReq(
}

fullpath := sandbox.GetAbsPath(f.FilePath)
size := f.FileSize
md5 := f.Md5
targetrelativepath := f.Targetrelativepath
filemode := f.Filemode
linkTarget := f.LinkTarget
modifytime := f.Lastmodifytime

// TODO : fresh file info here, avoid file info changed
newlyInfo := dcFile.Lstat(fullpath)
if !newlyInfo.Exist() {
blog.Warnf("file %f not existed when encode send request", fullpath)
continue
}
if size > 0 {
var newlyInfo *dcFile.Info
localdir := filepath.Dir(fullpath)
// 如果本地路径和远端不一样,则不能用Lstat
if localdir != targetrelativepath {
newlyInfo = dcFile.Stat(fullpath)
} else {
newlyInfo = dcFile.Lstat(fullpath)
}
if !newlyInfo.Exist() {
blog.Warnf("file %f not existed when encode send request", fullpath)
continue
}

size := newlyInfo.Size()
md5 := ""
if f.Md5 != "" {
md5, _ = newlyInfo.Md5()
size = newlyInfo.Size()
md5 = ""
if f.Md5 != "" {
md5, _ = newlyInfo.Md5()
}
filemode = newlyInfo.Mode32()
modifytime = newlyInfo.ModifyTime64()
}
filemode := newlyInfo.Mode32()
modifytime := newlyInfo.ModifyTime64()

// size := f.FileSize
// md5 := f.Md5
targetrelativepath := f.Targetrelativepath
// filemode := f.Filemode
linkTarget := f.LinkTarget
// modifytime := f.Lastmodifytime

if size <= 0 {
pbbody.Inputfiles = append(pbbody.Inputfiles, &protocol.PBFileDesc{
Expand Down
Loading