Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ Authors@R: c(person("Thomas J.", "Leeper", role = "aut",
person("Andrii", "Degtiarov", role = "ctb"),
person("Dhruv", "Aggarwal", role = "ctb"),
person("Alyssa", "Columbus", role = "ctb"),
person("Pieter", "Provoost", role = "ctb"),
person("Simon", "Urbanek", role = c("cre", "ctb"),
email = "[email protected]")
)
Expand Down
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
## Bugfixes

* `put_object` now closes its connections properly (#354)
* `get_bucket` now works with DigitalOcean (#393)


# aws.s3 0.3.21
Expand Down
10 changes: 5 additions & 5 deletions R/get_bucket.R
Original file line number Diff line number Diff line change
Expand Up @@ -45,20 +45,20 @@ get_bucket <- function(bucket,

if (isTRUE(parse_response)) {
while (
r[["IsTruncated"]] == "true" &&
(r[["IsTruncated"]] == "true" | "NextMarker" %in% names(r)) &&
!is.null(max) &&
as.integer(r[["MaxKeys"]]) < max
) {
query <- list(
prefix = prefix,
delimiter = delimiter,
"max-keys" = as.integer(pmin(max - as.integer(r[["MaxKeys"]]), 1000)),
marker = tail(r, 1)[["Contents"]][["Key"]]
marker = r[[max(which(names(r) == "Contents"))]][["Key"]]
)
extra <- s3HTTP(verb = "GET", bucket = bucket, query = query, parse_response = parse_response, ...)
new_r <- c(r, tail(extra, -5))
new_r[["MaxKeys"]] <- as.character(as.integer(r[["MaxKeys"]]) + as.integer(extra[["MaxKeys"]]))
new_r[["IsTruncated"]] <- extra[["IsTruncated"]]
r[["MaxKeys"]] <- as.character(as.integer(r[["MaxKeys"]]) + as.integer(extra[["MaxKeys"]]))
r[["IsTruncated"]] <- extra[["IsTruncated"]]
new_r <- c(r, extra[which(names(extra) == "Contents")])
attr(new_r, "x-amz-id-2") <- attr(r, "x-amz-id-2")
attr(new_r, "x-amz-request-id") <- attr(r, "x-amz-request-id")
attr(new_r, "date") <- attr(r, "date")
Expand Down