sync: Handle remote challenge files
This commit is contained in:
parent
ec3f818c30
commit
1d4b79bf90
5 changed files with 126 additions and 30 deletions
|
|
@ -234,7 +234,7 @@ func checkFileHash(filePath string, digest []byte) (dgst []byte, size int64, err
|
|||
// ImportFile registers (ou updates if it already exists in database) the file in database.
|
||||
func (e *Exercice) ImportFile(filePath string, origin string, digest []byte, digestshown []byte, disclaimer string, published bool) (interface{}, error) {
|
||||
if result512, size, err := checkFileHash(filePath, digest); !OptionalDigest && err != nil {
|
||||
return EFile{}, err
|
||||
return nil, err
|
||||
} else {
|
||||
dPath := strings.TrimPrefix(filePath, FilesDir)
|
||||
if f, err := e.GetFileByPath(dPath); err != nil {
|
||||
|
|
|
|||
Reference in a new issue