This commit is contained in:
Andrea Spacca 2019-03-18 19:09:22 +01:00
parent 2d5c256642
commit 5310566b81
2 changed files with 9 additions and 8 deletions

View file

@ -390,6 +390,8 @@ func (s *Server) putHandler(w http.ResponseWriter, r *http.Request) {
reader = r.Body
defer r.Body.Close()
if contentLength == -1 {
// queue file to disk, because s3 needs content length
var err error

View file

@ -402,11 +402,11 @@ func (s *GDrive) findId(filename string, token string) (string, error) {
q := fmt.Sprintf("'%s' in parents and name='%s' and mimeType='%s' and trashed=false", s.rootId, token, GDriveDirectoryMimeType)
l, err := s.list(nextPageToken, q)
for 0 < len(l.Files) {
if err != nil {
return "", err
}
for 0 < len(l.Files) {
for _, fi := range l.Files {
tokenId = fi.Id
break
@ -427,12 +427,11 @@ func (s *GDrive) findId(filename string, token string) (string, error) {
q = fmt.Sprintf("'%s' in parents and name='%s' and mimeType!='%s' and trashed=false", tokenId, filename, GDriveDirectoryMimeType)
l, err = s.list(nextPageToken, q)
for 0 < len(l.Files) {
if err != nil {
return "", err
}
for 0 < len(l.Files) {
for _, fi := range l.Files {
fileId = fi.Id