1
0
mirror of https://github.com/gilbertchen/duplicacy synced 2025-12-28 22:23:44 +00:00

Incorporated PR feedback; call S3 for IsFastListing() #322

This commit is contained in:
Mark Feit
2018-01-18 08:34:33 -05:00
parent 8aaca37a2b
commit b52d6b3f7f

View File

@@ -32,6 +32,7 @@ type WasabiStorage struct {
storageDir string
key string
secret string
client *http.Client
}
// See the Storage interface in duplicacy_storage.go for function
@@ -66,6 +67,7 @@ func CreateWasabiStorage(
storageDir: storageDir,
key: accessKey,
secret: secretKey,
client: &http.Client{},
}
wasabi.DerivedStorage = wasabi
@@ -129,12 +131,11 @@ func (storage *WasabiStorage) MoveFile(
request.Header.Add("Host", storage.endpoint)
request.Header.Add("Overwrite", "true")
client := &http.Client{}
response, error := client.Do(request)
response, error := storage.client.Do(request)
if error != nil {
return error
}
defer response.Body.Close()
if response.StatusCode != 200 {
return errors.New(response.Status)
@@ -182,7 +183,7 @@ func (storage *WasabiStorage) IsStrongConsistent() bool {
}
func (storage *WasabiStorage) IsFastListing() bool {
return true
return storage.s3.IsFastListing()
}
func (storage *WasabiStorage) EnableTestMode() {