bump HTTP::Tiny to CPAN version 0.022
authorJesse Luehrs <doy@tozt.net>
Mon, 18 Jun 2012 00:01:52 +0000 (19:01 -0500)
committerJesse Luehrs <doy@tozt.net>
Mon, 18 Jun 2012 00:01:52 +0000 (19:01 -0500)
Porting/Maintainers.pl
cpan/HTTP-Tiny/lib/HTTP/Tiny.pm
cpan/HTTP-Tiny/t/001_api.t

index c8f501c..11d336f 100755 (executable)
@@ -968,11 +968,12 @@ use File::Glob qw(:case);
 
     'HTTP::Tiny' => {
         'MAINTAINER'   => 'dagolden',
-        'DISTRIBUTION' => 'DAGOLDEN/HTTP-Tiny-0.021.tar.gz',
+        'DISTRIBUTION' => 'DAGOLDEN/HTTP-Tiny-0.022.tar.gz',
         'FILES'        => q[cpan/HTTP-Tiny],
         'EXCLUDED'     => [
             't/00-report-prereqs.t',
             't/200_live.t',
+            't/200_live_local_ip.t',
             't/210_live_ssl.t',
             qr/^eg/,
             qr/^xt/
index d69435e..01f4e92 100644 (file)
@@ -3,14 +3,14 @@ package HTTP::Tiny;
 use strict;
 use warnings;
 # ABSTRACT: A small, simple, correct HTTP/1.1 client
-our $VERSION = '0.021'; # VERSION
+our $VERSION = '0.022'; # VERSION
 
 use Carp ();
 
 
 my @attributes;
 BEGIN {
-    @attributes = qw(agent default_headers max_redirect max_size proxy timeout SSL_options verify_SSL);
+    @attributes = qw(agent default_headers local_address max_redirect max_size proxy timeout SSL_options verify_SSL);
     no strict 'refs';
     for my $accessor ( @attributes ) {
         *{$accessor} = sub {
@@ -193,9 +193,10 @@ sub _request {
     };
 
     my $handle  = HTTP::Tiny::Handle->new(
-        timeout     => $self->{timeout},
-        SSL_options => $self->{SSL_options},
-        verify_SSL  => $self->{verify_SSL},
+        timeout         => $self->{timeout},
+        SSL_options     => $self->{SSL_options},
+        verify_SSL      => $self->{verify_SSL},
+        local_address   => $self->{local_address},
     );
 
     if ($self->{proxy}) {
@@ -426,10 +427,11 @@ sub connect {
     elsif ( $scheme ne 'http' ) {
       die(qq/Unsupported URL scheme '$scheme'\n/);
     }
-
     $self->{fh} = 'IO::Socket::INET'->new(
         PeerHost  => $host,
         PeerPort  => $port,
+        $self->{local_address} ? 
+            ( LocalAddr => $self->{local_address} ) : (),
         Proto     => 'tcp',
         Type      => SOCK_STREAM,
         Timeout   => $self->{timeout}
@@ -887,7 +889,7 @@ HTTP::Tiny - A small, simple, correct HTTP/1.1 client
 
 =head1 VERSION
 
-version 0.021
+version 0.022
 
 =head1 SYNOPSIS
 
@@ -940,6 +942,12 @@ A hashref of default headers to apply to requests
 
 =item *
 
+C<local_address>
+
+The local IP address to bind to
+
+=item *
+
 C<max_redirect>
 
 Maximum number of redirects allowed (defaults to 5)
@@ -1155,6 +1163,7 @@ and value.
 
 =for Pod::Coverage agent
 default_headers
+local_address
 max_redirect
 max_size
 proxy
@@ -1305,6 +1314,10 @@ Only 'chunked' C<Transfer-Encoding> is supported.
 
 There is no support for a Request-URI of '*' for the 'OPTIONS' request.
 
+=item *
+
+There is no support for IPv6 of any kind.
+
 =back
 
 =head1 SEE ALSO
index 94b20a5..4311c67 100644 (file)
@@ -7,7 +7,7 @@ use Test::More tests => 2;
 use HTTP::Tiny;
 
 my @accessors = qw(
-  agent default_headers max_redirect max_size proxy timeout SSL_options verify_SSL
+  agent default_headers local_address max_redirect max_size proxy timeout SSL_options verify_SSL
 );
 my @methods   = qw(
   new get head put post delete post_form request mirror www_form_urlencode