r17725 - in /trunk/libnet-amazon-s3-perl: CHANGES META.yml Makefile.PL README debian/changelog lib/Net/Amazon/S3.pm lib/Net/Amazon/S3/Bucket.pm t/01api.t
roberto at users.alioth.debian.org
roberto at users.alioth.debian.org
Mon Mar 17 03:13:29 UTC 2008
Author: roberto
Date: Mon Mar 17 03:13:28 2008
New Revision: 17725
URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=17725
Log:
* New upstream release.
Modified:
trunk/libnet-amazon-s3-perl/CHANGES
trunk/libnet-amazon-s3-perl/META.yml
trunk/libnet-amazon-s3-perl/Makefile.PL
trunk/libnet-amazon-s3-perl/README
trunk/libnet-amazon-s3-perl/debian/changelog
trunk/libnet-amazon-s3-perl/lib/Net/Amazon/S3.pm
trunk/libnet-amazon-s3-perl/lib/Net/Amazon/S3/Bucket.pm
trunk/libnet-amazon-s3-perl/t/01api.t
Modified: trunk/libnet-amazon-s3-perl/CHANGES
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libnet-amazon-s3-perl/CHANGES?rev=17725&op=diff
==============================================================================
--- trunk/libnet-amazon-s3-perl/CHANGES (original)
+++ trunk/libnet-amazon-s3-perl/CHANGES Mon Mar 17 03:13:28 2008
@@ -1,4 +1,11 @@
Revision history for Perl module Net::Amazon::S3:
+
+0.43 Sat Mar 1 10:55:54 GMT 2008
+ - add binmode() to support Windows (thanks to Gabriel Weinberg)
+
+0.42 Thu Feb 28 06:39:59 GMT 2008
+ - add exponential backoff upon temporary errors with the new
+ retry option
0.41 Fri Nov 30 10:42:26 GMT 2007
- fix the expensive tests (patch by BDOLAN)
Modified: trunk/libnet-amazon-s3-perl/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libnet-amazon-s3-perl/META.yml?rev=17725&op=diff
==============================================================================
--- trunk/libnet-amazon-s3-perl/META.yml (original)
+++ trunk/libnet-amazon-s3-perl/META.yml Mon Mar 17 03:13:28 2008
@@ -1,11 +1,11 @@
--- #YAML:1.0
name: Net-Amazon-S3
-version: 0.41
+version: 0.43
abstract: ~
license: perl
author:
- Leon Brocard <acme at astray.com>
-generated_by: ExtUtils::MakeMaker version 6.38
+generated_by: ExtUtils::MakeMaker version 6.42
distribution_type: module
requires:
Class::Accessor::Fast: 0
@@ -13,7 +13,7 @@
Digest::HMAC_SHA1: 0
Digest::MD5::File: 0
HTTP::Date: 0
- LWP::UserAgent: 0
+ LWP::UserAgent::Determined: 0
MIME::Base64: 0
Test::More: 0.01
URI::Escape: 0
Modified: trunk/libnet-amazon-s3-perl/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libnet-amazon-s3-perl/Makefile.PL?rev=17725&op=diff
==============================================================================
--- trunk/libnet-amazon-s3-perl/Makefile.PL (original)
+++ trunk/libnet-amazon-s3-perl/Makefile.PL Mon Mar 17 03:13:28 2008
@@ -13,7 +13,7 @@
'Digest::MD5::File' => '0',
'Digest::HMAC_SHA1' => '0',
'HTTP::Date' => '0',
- 'LWP::UserAgent' => '0',
+ 'LWP::UserAgent::Determined' => '0',
'MIME::Base64' => '0',
'Test::More' => '0.01',
'XML::LibXML' => '0',
Modified: trunk/libnet-amazon-s3-perl/README
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libnet-amazon-s3-perl/README?rev=17725&op=diff
==============================================================================
--- trunk/libnet-amazon-s3-perl/README (original)
+++ trunk/libnet-amazon-s3-perl/README Mon Mar 17 03:13:28 2008
@@ -116,6 +116,11 @@
How many seconds should your script wait before bailing on a request
to S3? Defaults to 30.
+ retry
+ If this library should retry upon errors. This option is
+ recommended. This uses exponential backoff with retries after 1, 2,
+ 4, 8, 16, 32 seconds, as recommended by Amazon.
+
buckets
Returns undef on error, else hashref of results
@@ -127,6 +132,12 @@
acl_short (optional)
See the set_acl subroutine for documenation on the acl_short options
+
+ location_constraint (option)
+ Sets the location constraint of the new bucket. If left unspecified,
+ the default S3 datacenter location will be used. Otherwise, you can
+ set it to 'EU' for a European data center - note that costs are
+ different.
Returns 0 on failure, Net::Amazon::S3::Bucket object on success
Modified: trunk/libnet-amazon-s3-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libnet-amazon-s3-perl/debian/changelog?rev=17725&op=diff
==============================================================================
--- trunk/libnet-amazon-s3-perl/debian/changelog (original)
+++ trunk/libnet-amazon-s3-perl/debian/changelog Mon Mar 17 03:13:28 2008
@@ -1,3 +1,9 @@
+libnet-amazon-s3-perl (0.43-1) unstable; urgency=low
+
+ * New upstream release.
+
+ -- Roberto C. Sanchez <roberto at debian.org> Sun, 16 Mar 2008 23:13:01 -0400
+
libnet-amazon-s3-perl (0.41-1) unstable; urgency=low
[ gregor herrmann ]
Modified: trunk/libnet-amazon-s3-perl/lib/Net/Amazon/S3.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libnet-amazon-s3-perl/lib/Net/Amazon/S3.pm?rev=17725&op=diff
==============================================================================
--- trunk/libnet-amazon-s3-perl/lib/Net/Amazon/S3.pm (original)
+++ trunk/libnet-amazon-s3-perl/lib/Net/Amazon/S3.pm Mon Mar 17 03:13:28 2008
@@ -15,6 +15,7 @@
my $s3 = Net::Amazon::S3->new(
{ aws_access_key_id => $aws_access_key_id,
aws_secret_access_key => $aws_secret_access_key,
+ retry => 1,
}
);
@@ -102,16 +103,16 @@
use HTTP::Date;
use MIME::Base64 qw(encode_base64);
use Net::Amazon::S3::Bucket;
-use LWP::UserAgent;
+use LWP::UserAgent::Determined;
use URI::Escape qw(uri_escape_utf8);
use XML::LibXML;
use XML::LibXML::XPathContext;
use base qw(Class::Accessor::Fast);
__PACKAGE__->mk_accessors(
- qw(libxml aws_access_key_id aws_secret_access_key secure ua err errstr timeout)
+ qw(libxml aws_access_key_id aws_secret_access_key secure ua err errstr timeout retry)
);
-our $VERSION = '0.41';
+our $VERSION = '0.43';
my $AMAZON_HEADER_PREFIX = 'x-amz-';
my $METADATA_PREFIX = 'x-amz-meta-';
@@ -152,6 +153,12 @@
How many seconds should your script wait before bailing on a request to S3? Defaults
to 30.
+=item retry
+
+If this library should retry upon errors. This option is recommended.
+This uses exponential backoff with retries after 1, 2, 4, 8, 16, 32 seconds,
+as recommended by Amazon. Defaults to off.
+
=back
=cut
@@ -166,12 +173,23 @@
$self->secure(0) if not defined $self->secure;
$self->timeout(30) if not defined $self->timeout;
- my $ua = LWP::UserAgent->new(
- keep_alive => $KEEP_ALIVE_CACHESIZE,
- requests_redirectable => [qw(GET HEAD DELETE PUT)],
- );
+ my $ua;
+ if ( $self->retry ) {
+ $ua = LWP::UserAgent::Determined->new(
+ keep_alive => $KEEP_ALIVE_CACHESIZE,
+ requests_redirectable => [qw(GET HEAD DELETE PUT)],
+ );
+ $ua->timing('1,2,4,8,16,32');
+ } else {
+ $ua = LWP::UserAgent->new(
+ keep_alive => $KEEP_ALIVE_CACHESIZE,
+ requests_redirectable => [qw(GET HEAD DELETE PUT)],
+ );
+ }
+
$ua->timeout( $self->timeout );
$ua->env_proxy;
+
$self->ua($ua);
$self->libxml( XML::LibXML->new );
return $self;
Modified: trunk/libnet-amazon-s3-perl/lib/Net/Amazon/S3/Bucket.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libnet-amazon-s3-perl/lib/Net/Amazon/S3/Bucket.pm?rev=17725&op=diff
==============================================================================
--- trunk/libnet-amazon-s3-perl/lib/Net/Amazon/S3/Bucket.pm (original)
+++ trunk/libnet-amazon-s3-perl/lib/Net/Amazon/S3/Bucket.pm Mon Mar 17 03:13:28 2008
@@ -3,6 +3,7 @@
use warnings;
use Carp;
use File::stat;
+use IO::File;
use base qw(Class::Accessor::Fast);
__PACKAGE__->mk_accessors(qw(bucket creation_date account));
@@ -460,13 +461,23 @@
croak "$filename not a readable file with fixed size"
unless -r $filename and $remaining;
- open DATA, "< $filename" or croak "Could not open $filename: $!";
+ my $fh = IO::File->new( $filename, 'r' )
+ or croak "Could not open $filename: $!";
+ $fh->binmode;
return sub {
my $buffer;
+ # upon retries the file is closed and we must reopen it
+ unless ( $fh->opened ) {
+ $fh = IO::File->new( $filename, 'r' )
+ or croak "Could not open $filename: $!";
+ $fh->binmode;
+ $remaining = $stat->size;
+ }
+
# warn "read remaining $remaining";
- unless ( my $read = read( DATA, $buffer, $blksize ) ) {
+ unless ( my $read = $fh->read( $buffer, $blksize ) ) {
# warn "read $read buffer $buffer remaining $remaining";
croak
@@ -474,7 +485,7 @@
if $! and $remaining;
# otherwise, we found EOF
- close DATA
+ $fh->close
or croak "close of upload content $filename failed: $!";
$buffer ||= ''
; # LWP expects an emptry string on finish, read returns 0
Modified: trunk/libnet-amazon-s3-perl/t/01api.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libnet-amazon-s3-perl/t/01api.t?rev=17725&op=diff
==============================================================================
--- trunk/libnet-amazon-s3-perl/t/01api.t (original)
+++ trunk/libnet-amazon-s3-perl/t/01api.t Mon Mar 17 03:13:28 2008
@@ -23,7 +23,8 @@
my $s3 = Net::Amazon::S3->new(
{ aws_access_key_id => $aws_access_key_id,
- aws_secret_access_key => $aws_secret_access_key
+ aws_secret_access_key => $aws_secret_access_key,
+ retry => 1,
}
);
More information about the Pkg-perl-cvs-commits
mailing list