s3tools/s3cmd — pull request #90 by kellymclaughlin (2012-12-06 00:05:09+00:00)
Title: Reuse a single connection when doing a bucket list

Listing the contents of a bucket can involve multiple requests if the
bucket is sufficiently large. The default behavior is to list the
objects in batches of 1000. Currently a new connection is created for
each batch and this results in unnecessary connection establishment
overhead when listing a bucket involves multiple batches. This commit
moves the connection creation for listing a bucket into the
`bucket_list` function and changes the `send_request` function to
optionally accept an existing connection as a parameter. This allows
the same connection to be reused for listing the entire contents of a
bucket.