Skip to content

Commit

Permalink
Only querying location for bucket requires no fallback.
Browse files Browse the repository at this point in the history
This reverts commit f93b1cf.
  • Loading branch information
dkocher committed Nov 1, 2024
1 parent 73aba70 commit c78789d
Showing 1 changed file with 14 additions and 26 deletions.
40 changes: 14 additions & 26 deletions s3/src/main/java/ch/cyberduck/core/s3/S3Session.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,7 @@
import ch.cyberduck.core.cloudfront.CloudFrontDistributionConfigurationPreloader;
import ch.cyberduck.core.cloudfront.WebsiteCloudFrontDistributionConfiguration;
import ch.cyberduck.core.date.RFC822DateFormatter;
import ch.cyberduck.core.exception.AccessDeniedException;
import ch.cyberduck.core.exception.BackgroundException;
import ch.cyberduck.core.exception.InteroperabilityException;
import ch.cyberduck.core.exception.LoginCanceledException;
import ch.cyberduck.core.features.*;
import ch.cyberduck.core.http.CustomServiceUnavailableRetryStrategy;
Expand All @@ -51,7 +49,6 @@
import ch.cyberduck.core.preferences.PreferencesReader;
import ch.cyberduck.core.proxy.ProxyFinder;
import ch.cyberduck.core.restore.Glacier;
import ch.cyberduck.core.shared.DefaultHomeFinderService;
import ch.cyberduck.core.shared.DefaultPathHomeFeature;
import ch.cyberduck.core.shared.DelegatingHomeFeature;
import ch.cyberduck.core.shared.DisabledBulkFeature;
Expand Down Expand Up @@ -364,32 +361,23 @@ public void login(final LoginCallback prompt, final CancelCallback cancel) throw
}
}
else {
try {
final Path home = new DelegatingHomeFeature(new DefaultPathHomeFeature(host)).find();
if(home.isRoot()) {
if(log.isDebugEnabled()) {
log.debug(String.format("Skip querying region for %s", home));
}
}
else {
final Location.Name location = new S3LocationFeature(S3Session.this, regions).getLocation(home);
if(log.isDebugEnabled()) {
log.debug(String.format("Retrieved region %s", location));
}
if(!Location.unknown.equals(location)) {
if(log.isDebugEnabled()) {
log.debug(String.format("Set default region to %s determined from %s", location, home));
}
//
host.setProperty("s3.location", location.getIdentifier());
}
final Path home = new DelegatingHomeFeature(new DefaultPathHomeFeature(host)).find();
if(home.isRoot()) {
if(log.isDebugEnabled()) {
log.debug(String.format("Skip querying region for %s", home));
}
}
catch(AccessDeniedException | InteroperabilityException e) {
log.warn(String.format("Failure %s querying region", e));
final Path home = new DefaultHomeFinderService(this).find();
else {
final Location.Name location = new S3LocationFeature(this, regions).getLocation(home);
if(log.isDebugEnabled()) {
log.debug(String.format("Retrieved %s", home));
log.debug(String.format("Retrieved region %s", location));
}
if(!Location.unknown.equals(location)) {
if(log.isDebugEnabled()) {
log.debug(String.format("Set default region to %s determined from %s", location, home));
}
//
host.setProperty("s3.location", location.getIdentifier());
}
}
}
Expand Down

0 comments on commit c78789d

Please sign in to comment.