Permalink
Browse files

Quoting fixes on recursive deletes during upload sync.

  • Loading branch information...
1 parent 91f83af commit 2853d27bb38955216de0d024298611fa5cd39662 @dustin dustin committed Oct 7, 2012
Showing with 4 additions and 3 deletions.
  1. +1 −1 cbfsclient/rm.go
  2. +3 −2 cbfsclient/upload.go
View
@@ -51,7 +51,7 @@ func rmFile(u string) error {
res.Body.Close()
if res.StatusCode != 204 && res.StatusCode != 404 {
return fmt.Errorf("Unexpected status deleting %v: %v",
- u, err)
+ u, res.Status)
}
return nil
}
View
@@ -212,6 +212,7 @@ func uploadFile(src, dest, localHash string) error {
// This is very similar to rm's version, but uses different channel
// signaling.
func uploadRmDashR(baseUrl string, ch chan uploadReq) ([]string, error) {
+ r := quotingReplacer
for strings.HasSuffix(baseUrl, "/") {
baseUrl = baseUrl[:len(baseUrl)-1]
}
@@ -221,14 +222,14 @@ func uploadRmDashR(baseUrl string, ch chan uploadReq) ([]string, error) {
return []string{}, err
}
for fn := range listing.Files {
- err = rmFile(baseUrl + "/" + fn)
+ err = rmFile(baseUrl + "/" + r.Replace(fn))
if err != nil {
return []string{}, err
}
}
children := make([]string, 0, len(listing.Dirs))
for dn := range listing.Dirs {
- children = append(children, baseUrl+"/"+dn)
+ children = append(children, baseUrl+"/"+r.Replace(dn))
}
return children, nil
}

0 comments on commit 2853d27

Please sign in to comment.