r11055 - in /trunk/libwww-perl: ./ bin/ debian/ lib/ lib/HTTP/ lib/HTTP/Request/ lib/LWP/ lib/LWP/Protocol/ lib/Net/ t/base/ t/live/ t/local/
tincho-guest at users.alioth.debian.org
tincho-guest at users.alioth.debian.org
Sun Dec 9 10:17:57 UTC 2007
Author: tincho-guest
Date: Sun Dec 9 10:17:57 2007
New Revision: 11055
URL: http://svn.debian.org/wsvn/?sc=1&rev=11055
Log:
* New upstream release. Closes: #386565 (and probably many more).
* debian/control:
- Bumped very old Standards-Version.
- Moved debhelper to Build-Depends.
- Added quilt build-dependency for documentation patches to be added.
- New run-time dependency: libhtml-tagset-perl.
* debian/compat: to version 5.
* debian/copyright: converted to UTF-8 and updated.
* debian/rules: revamped with current group practices. Added quilt support.
Added:
trunk/libwww-perl/t/live/apache.t
- copied unchanged from r11054, branches/upstream/libwww-perl/current/t/live/apache.t
trunk/libwww-perl/t/local/chunked.t
- copied unchanged from r11054, branches/upstream/libwww-perl/current/t/local/chunked.t
Removed:
trunk/libwww-perl/t/live/activestate.t
trunk/libwww-perl/t/live/validator.t
Modified:
trunk/libwww-perl/Changes
trunk/libwww-perl/MANIFEST
trunk/libwww-perl/Makefile.PL
trunk/libwww-perl/bin/lwp-download
trunk/libwww-perl/bin/lwp-request
trunk/libwww-perl/debian/changelog
trunk/libwww-perl/debian/compat
trunk/libwww-perl/debian/control
trunk/libwww-perl/debian/copyright
trunk/libwww-perl/debian/rules
trunk/libwww-perl/lib/HTTP/Daemon.pm
trunk/libwww-perl/lib/HTTP/Request/Common.pm
trunk/libwww-perl/lib/LWP.pm
trunk/libwww-perl/lib/LWP/MediaTypes.pm
trunk/libwww-perl/lib/LWP/Protocol.pm
trunk/libwww-perl/lib/LWP/Protocol/https10.pm
trunk/libwww-perl/lib/LWP/Protocol/nntp.pm
trunk/libwww-perl/lib/LWP/UserAgent.pm
trunk/libwww-perl/lib/Net/HTTPS.pm
trunk/libwww-perl/t/base/message.t
trunk/libwww-perl/t/local/http-get.t
trunk/libwww-perl/talk-to-ourself
Modified: trunk/libwww-perl/Changes
URL: http://svn.debian.org/wsvn/trunk/libwww-perl/Changes?rev=11055&op=diff
==============================================================================
--- trunk/libwww-perl/Changes (original)
+++ trunk/libwww-perl/Changes Sun Dec 9 10:17:57 2007
@@ -1,3 +1,60 @@
+2007-08-05 Gisle Aas <gisle at ActiveState.com>
+
+ Release 5.808
+
+ Get rid of t/live/validator test. Too much JavaScript madness
+ for it to be a sane LWP test.
+
+
+
+2007-07-31 Gisle Aas <gisle at ActiveState.com>
+
+ Release 5.807
+
+ Apply patch correction from CPAN RT #26152
+
+ More laxed t/live/validator test.
+
+
+
+2007-07-19 Gisle Aas <gisle at ActiveState.com>
+
+ Release 5.806
+
+ Added progress callback to LWP::UserAgent.
+
+ HTTP::Daemon didn't avoid content in responses to HEAD requests
+
+ Add support for HTTP Expect header to HTTP::Daemon (CPAN RT #27933)
+
+ Fix t/base/message.t so tests are skipped if Encode is not
+ installed. (CPAN RT #25286)
+
+ Add HTML::Tagset as a prerequisite to Makefile.PL
+
+ Do not clobber $_ in LWP::Protocol::nntp (CPAN RT #25132)
+
+ Fix lwp-download so it can download files with an "_" in the filename
+ (CPAN RT#26207)
+
+ Quiet complaints from HTML::HeadParser when dealing with undecoded
+ UTF-8 data. (CPAN RT#20274)
+
+ When both IO::Socket::SSL and Net::SSL are loaded, use the latter
+ (CPAN RT #26152)
+
+ Allows SSL to work much more reliably:
+ (CPAN RT #23372)
+
+ Allow text/vnd.wap.wml and application/vnd.oasis.opendocument.text
+ in content-type field in lwp-request (CPAN RT #26151)
+
+ Add default media type for XML in LWP::MediaTypes (CPAN RT #21093)
+
+ Added chunked test by Andreas J. Koenig
+
+
+
2005-12-08 Gisle Aas <gisle at ActiveState.com>
Release 5.805
Modified: trunk/libwww-perl/MANIFEST
URL: http://svn.debian.org/wsvn/trunk/libwww-perl/MANIFEST?rev=11055&op=diff
==============================================================================
--- trunk/libwww-perl/MANIFEST (original)
+++ trunk/libwww-perl/MANIFEST Sun Dec 9 10:17:57 2007
@@ -85,7 +85,7 @@
t/base/ua.t Basic LWP::UserAgent tests
t/html/form.t Test HTML::Form module
t/html/form-param.t More HTML::Form tests.
-t/live/activestate.t
+t/live/apache.t
t/live/apache-listing.t Test File::Listing::apache package
t/live/jigsaw-auth-b.t
t/live/jigsaw-auth-d.t
@@ -95,9 +95,9 @@
t/live/jigsaw-neg-get.t
t/live/jigsaw-neg.t
t/live/jigsaw-te.t
-t/live/validator.t
t/local/autoload-get.t
t/local/autoload.t Test autoloading of LWP::Protocol modules
+t/local/chunked.t
t/local/get.t Try to get a local file
t/local/http-get.t
t/local/http.t Test http to local server
Modified: trunk/libwww-perl/Makefile.PL
URL: http://svn.debian.org/wsvn/trunk/libwww-perl/Makefile.PL?rev=11055&op=diff
==============================================================================
--- trunk/libwww-perl/Makefile.PL (original)
+++ trunk/libwww-perl/Makefile.PL Sun Dec 9 10:17:57 2007
@@ -1,5 +1,5 @@
# This -*- perl -*- script writes the Makefile for libwww-perl
-# $Id: Makefile.PL,v 1.76 2005/11/03 17:26:39 gisle Exp $
+# $Id: Makefile.PL,v 1.77 2007/07/19 20:26:10 gisle Exp $
require 5.005;
use strict;
@@ -273,6 +273,7 @@
PREREQ_PM => { 'URI' => "1.10",
'MIME::Base64' => "2.1",
'Net::FTP' => "2.58",
+ 'HTML::Tagset' => 0,
'HTML::Parser' => "3.33",
'Digest::MD5' => 0,
'Compress::Zlib' => "1.10",
Modified: trunk/libwww-perl/bin/lwp-download
URL: http://svn.debian.org/wsvn/trunk/libwww-perl/bin/lwp-download?rev=11055&op=diff
==============================================================================
--- trunk/libwww-perl/bin/lwp-download (original)
+++ trunk/libwww-perl/bin/lwp-download Sun Dec 9 10:17:57 2007
@@ -1,6 +1,6 @@
#!/usr/bin/perl -w
-# $Id: lwp-download,v 2.15 2004/12/11 14:02:59 gisle Exp $
+# $Id: lwp-download,v 2.16 2007/07/19 20:26:11 gisle Exp $
=head1 NAME
@@ -75,7 +75,7 @@
my $url = URI->new(shift || usage());
my $argfile = shift;
usage() if defined($argfile) && !length($argfile);
-my $version = q$Revision: 2.15 $;
+my $version = q$Revision: 2.16 $;
$version =~ s/[^\d.]//g;
my $ua = LWP::UserAgent->new(
@@ -150,7 +150,7 @@
# validate that we don't have a harmful filename now. The server
# might try to trick us into doing something bad.
if (!length($file) ||
- $file =~ s/([^a-zA-Z0-9\.\-\+\~])/sprintf "\\x%02x", ord($1)/ge)
+ $file =~ s/([^a-zA-Z0-9_\.\-\+\~])/sprintf "\\x%02x", ord($1)/ge)
{
die "Will not save <$url> as \"$file\".\nPlease override file name on the command line.\n";
}
Modified: trunk/libwww-perl/bin/lwp-request
URL: http://svn.debian.org/wsvn/trunk/libwww-perl/bin/lwp-request?rev=11055&op=diff
==============================================================================
--- trunk/libwww-perl/bin/lwp-request (original)
+++ trunk/libwww-perl/bin/lwp-request Sun Dec 9 10:17:57 2007
@@ -1,6 +1,6 @@
#!/usr/bin/perl -w
-# $Id: lwp-request,v 2.7 2005/12/06 12:16:28 gisle Exp $
+# $Id: lwp-request,v 2.8 2007/07/19 20:26:11 gisle Exp $
#
# Simple user agent using LWP library.
@@ -182,7 +182,7 @@
$progname =~ s,.*[\\/],,; # use basename only
$progname =~ s/\.\w*$//; # strip extension, if any
-$VERSION = sprintf("%d.%02d", q$Revision: 2.7 $ =~ /(\d+)\.(\d+)/);
+$VERSION = sprintf("%d.%02d", q$Revision: 2.8 $ =~ /(\d+)\.(\d+)/);
require LWP;
@@ -366,7 +366,7 @@
}
else {
die "$progname: Illegal Content-type format\n"
- unless $options{'c'} =~ m,^[\w\-]+/[\w\-]+(?:\s*;.*)?$,
+ unless $options{'c'} =~ m,^[\w\-]+/[\w\-.+]+(?:\s*;.*)?$,
}
print "Please enter content ($options{'c'}) to be ${method}ed:\n"
if -t;
Modified: trunk/libwww-perl/debian/changelog
URL: http://svn.debian.org/wsvn/trunk/libwww-perl/debian/changelog?rev=11055&op=diff
==============================================================================
--- trunk/libwww-perl/debian/changelog (original)
+++ trunk/libwww-perl/debian/changelog Sun Dec 9 10:17:57 2007
@@ -1,3 +1,17 @@
+libwww-perl (5.808-1) UNRELEASED; urgency=low
+
+ * New upstream release. Closes: #386565 (and probably many more).
+ * debian/control:
+ - Bumped very old Standards-Version.
+ - Moved debhelper to Build-Depends.
+ - Added quilt build-dependency for documentation patches to be added.
+ - New run-time dependency: libhtml-tagset-perl.
+ * debian/compat: to version 5.
+ * debian/copyright: converted to UTF-8 and updated.
+ * debian/rules: revamped with current group practices. Added quilt support.
+
+ -- MartÃn Ferrari <martin.ferrari at gmail.com> Sun, 09 Dec 2007 07:14:01 -0300
+
libwww-perl (5.805-2) UNRELEASED; urgency=low
* debian/control: Added: Vcs-Svn field (source stanza); Vcs-Browser
Modified: trunk/libwww-perl/debian/compat
URL: http://svn.debian.org/wsvn/trunk/libwww-perl/debian/compat?rev=11055&op=diff
==============================================================================
--- trunk/libwww-perl/debian/compat (original)
+++ trunk/libwww-perl/debian/compat Sun Dec 9 10:17:57 2007
@@ -1,1 +1,1 @@
-4
+5
Modified: trunk/libwww-perl/debian/control
URL: http://svn.debian.org/wsvn/trunk/libwww-perl/debian/control?rev=11055&op=diff
==============================================================================
--- trunk/libwww-perl/debian/control (original)
+++ trunk/libwww-perl/debian/control Sun Dec 9 10:17:57 2007
@@ -3,17 +3,24 @@
Section: perl
Maintainer: Debian Perl Group <pkg-perl-maintainers at lists.alioth.debian.org>
Uploaders: Jay Bonci <jaybonci at debian.org>
-Standards-Version: 3.6.2.2
+Standards-Version: 3.7.3
Homepage: http://search.cpan.org/dist/libwww-perl/
Vcs-Svn: svn://svn.debian.org/pkg-perl/trunk/libwww-perl/
Vcs-Browser: http://svn.debian.org/wsvn/pkg-perl/trunk/libwww-perl/
-Build-Depends-Indep: debhelper (>= 4.1.0), netbase, perl (>= 5.6.1-7), libnet-perl (>= 1:1.09) | perl (>= 5.8.1), libdigest-md5-perl, libmime-base64-perl (>= 2.1) | perl (>= 5.8), liburi-perl (>= 1.10), libhtml-parser-perl (>= 3.33), libcompress-zlib-perl
+Build-Depends: debhelper (>= 5), quilt
+Build-Depends-Indep: netbase, perl (>= 5.6.1-7),
+ libnet-perl (>= 1:1.09) | perl (>= 5.8.1), libdigest-md5-perl,
+ libmime-base64-perl (>= 2.1) | perl (>= 5.8), liburi-perl (>= 1.10),
+ libhtml-parser-perl (>= 3.33), libcompress-zlib-perl
Package: libwww-perl
Architecture: all
Priority: optional
Section: perl
-Depends: ${perl:Depends}, libnet-perl (>= 1:1.09) | perl (>= 5.8.1), libdigest-md5-perl, libmime-base64-perl (>= 2.1) | perl (>= 5.8), liburi-perl (>= 1.10), libhtml-parser-perl (>= 3.33), libhtml-tree-perl (>= 3.11)
+Depends: ${perl:Depends}, libnet-perl (>= 1:1.09) | perl (>= 5.8.1),
+ libdigest-md5-perl, libmime-base64-perl (>= 2.1) | perl (>= 5.8),
+ liburi-perl (>= 1.10), libhtml-parser-perl (>= 3.33),
+ libhtml-tree-perl (>= 3.11), libhtml-tagset-perl
Recommends: libmailtools-perl, libhtml-format-perl, libcompress-zlib-perl
Suggests: libio-socket-ssl-perl (>= 0.81-2)
Description: WWW client/server library for Perl (aka LWP)
Modified: trunk/libwww-perl/debian/copyright
URL: http://svn.debian.org/wsvn/trunk/libwww-perl/debian/copyright?rev=11055&op=diff
==============================================================================
--- trunk/libwww-perl/debian/copyright (original)
+++ trunk/libwww-perl/debian/copyright Sun Dec 9 10:17:57 2007
@@ -20,8 +20,8 @@
COPYRIGHT
- © 1995-1999 Gisle Aas. All rights reserved.
- © 1995 Martijn Koster. All rights reserved.
+ © 1995-2005 Gisle Aas. All rights reserved.
+ © 1995 Martijn Koster. All rights reserved.
This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself.
Modified: trunk/libwww-perl/debian/rules
URL: http://svn.debian.org/wsvn/trunk/libwww-perl/debian/rules?rev=11055&op=diff
==============================================================================
--- trunk/libwww-perl/debian/rules (original)
+++ trunk/libwww-perl/debian/rules Sun Dec 9 10:17:57 2007
@@ -1,14 +1,21 @@
#!/usr/bin/make -f
# -*- Makefile -*-
-# Use debhelper V. 4
-# export DH_COMPAT := 4
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
+
+# If set to a true value then MakeMaker's prompt function will
+# always return the default without waiting for user input.
+export PERL_MM_USE_DEFAULT=1
+
+PACKAGE = $(shell dh_listpackages)
# Make sure perl is defined (allow overriding from the command line
PERL ?= /usr/bin/perl
-# Set our build directory
-b := $(shell pwd)/debian/libwww-perl
+include /usr/share/quilt/quilt.make
+
+TMP = $(CURDIR)/debian/$(PACKAGE)
arrange: arrange-stamp
arrange-stamp: install
@@ -44,34 +51,37 @@
touch binary-indep-stamp
build: build-stamp
-build-stamp:
+build-stamp: $(QUILT_STAMPFN)
dh_testdir
- echo "y" | $(PERL) Makefile.PL INSTALLDIRS=vendor
- if [ -f t/live/ENABLED ]; then rm t/live/ENABLED; fi # Turn off the live checks
- if [ -f t/live/ZLIB_OK ]; then rm t/live/ZLIB_OK; fi # Turn off the live checks
+ $(PERL) Makefile.PL INSTALLDIRS=vendor \
+ INSTALLVENDORARCH=/usr/share/perl5/ \
+ VENDORARCHEXP=/usr/share/perl5/
+ # Turn off the live checks
+ if [ -f t/live/ENABLED ]; then rm t/live/ENABLED; fi
+ if [ -f t/live/ZLIB_OK ]; then rm t/live/ZLIB_OK; fi
$(MAKE)
$(MAKE) test
touch build-stamp
-clean:
+clean: unpatch
dh_testdir
dh_testroot
if [ -e Makefile ]; then $(MAKE) -i distclean; fi
- dh_clean arrange-stamp binary-stamp binary-arch-stamp binary-indep-stamp build-stamp install-stamp
+ dh_clean arrange-stamp binary-stamp binary-arch-stamp \
+ binary-indep-stamp build-stamp install-stamp
install: install-stamp
install-stamp: build
dh_testdir
- $(MAKE) install PREFIX=$(b)/usr
+ $(MAKE) install DESTDIR=$(TMP) PREFIX=/usr
- rm -f $(b)/usr/bin/GET \
- $(b)/usr/bin/POST \
- $(b)/usr/bin/HEAD
+ rm -f $(TMP)/usr/bin/GET \
+ $(TMP)/usr/bin/POST \
+ $(TMP)/usr/bin/HEAD
- rm -f $(b)/usr/share/man/man1/GET.1p \
- $(b)/usr/share/man/man1/HEAD.1p \
- $(b)/usr/share/man/man1/POST.1p
- -find $(CURDIR)/debian -type d | xargs rmdir -p --ignore-fail-on-non-empty
+ rm -f $(TMP)/usr/share/man/man1/GET.1p \
+ $(TMP)/usr/share/man/man1/HEAD.1p \
+ $(TMP)/usr/share/man/man1/POST.1p
touch install-stamp
.PHONY: arrange binary binary-arch binary-indep build clean install
Modified: trunk/libwww-perl/lib/HTTP/Daemon.pm
URL: http://svn.debian.org/wsvn/trunk/libwww-perl/lib/HTTP/Daemon.pm?rev=11055&op=diff
==============================================================================
--- trunk/libwww-perl/lib/HTTP/Daemon.pm (original)
+++ trunk/libwww-perl/lib/HTTP/Daemon.pm Sun Dec 9 10:17:57 2007
@@ -1,11 +1,11 @@
package HTTP::Daemon;
-# $Id: Daemon.pm,v 1.36 2004/12/11 14:13:16 gisle Exp $
+# $Id: Daemon.pm,v 1.39 2007/07/19 21:24:31 gisle Exp $
use strict;
use vars qw($VERSION @ISA $PROTO $DEBUG);
-$VERSION = sprintf("%d.%02d", q$Revision: 1.36 $ =~ /(\d+)\.(\d+)/);
+$VERSION = sprintf("%d.%02d", q$Revision: 1.39 $ =~ /(\d+)\.(\d+)/);
use IO::Socket qw(AF_INET INADDR_ANY inet_ntoa);
@ISA=qw(IO::Socket::INET);
@@ -150,6 +150,7 @@
my $r = HTTP::Request->new($method, $uri);
$r->protocol($proto);
${*$self}{'httpd_client_proto'} = $proto = _http_version($proto);
+ ${*$self}{'httpd_head'} = ($method eq "HEAD");
if ($proto >= $HTTP_1_0) {
# we expect to find some headers
@@ -190,6 +191,18 @@
my $te = $r->header('Transfer-Encoding');
my $ct = $r->header('Content-Type');
my $len = $r->header('Content-Length');
+
+ # Act on the Expect header, if it's there
+ for my $e ( $r->header('Expect') ) {
+ if( lc($e) eq '100-continue' ) {
+ $self->send_status_line(100);
+ }
+ else {
+ $self->send_error(417);
+ $self->reason("Unsupported Expect header value");
+ return;
+ }
+ }
if ($te && lc($te) eq 'chunked') {
# Handle chunked transfer encoding
@@ -375,6 +388,12 @@
${*$self}{'httpd_nomore'}++;
}
+sub head_request
+{
+ my $self = shift;
+ ${*$self}{'httpd_head'};
+}
+
sub send_status_line
{
@@ -440,11 +459,15 @@
}
else {
$self->force_last_request;
+ $res->header('connection','close');
}
print $self $res->headers_as_string($CRLF);
print $self $CRLF; # separates headers and content
}
- if (ref($content) eq "CODE") {
+ if ($self->head_request) {
+ # no content
+ }
+ elsif (ref($content) eq "CODE") {
while (1) {
my $chunk = &$content();
last unless defined($chunk) && length($chunk);
@@ -478,7 +501,7 @@
print $self "Content-Type: $ct$CRLF";
}
print $self $CRLF;
- print $self $content if $content;
+ print $self $content if $content && !$self->head_request;
$self->force_last_request; # no use keeping the connection open
}
@@ -501,7 +524,7 @@
print $self "Content-Length: " . length($mess) . $CRLF;
print $self $CRLF;
}
- print $self $mess;
+ print $self $mess unless $self->head_request;
$status;
}
@@ -528,7 +551,7 @@
print $self "Last-Modified: ", time2str($mtime), "$CRLF" if $mtime;
print $self $CRLF;
}
- $self->send_file(\*F);
+ $self->send_file(\*F) unless $self->head_request;
return RC_OK;
}
else {
@@ -748,6 +771,11 @@
code and no headers should be returned to such a client. This should
be the same as !$c->proto_ge("HTTP/1.0").
+=item $c->head_request
+
+Return TRUE if the last request was a C<HEAD> request. No content
+body must be generated for these requests.
+
=item $c->force_last_request
Make sure that $c->get_request will not try to read more requests off
Modified: trunk/libwww-perl/lib/HTTP/Request/Common.pm
URL: http://svn.debian.org/wsvn/trunk/libwww-perl/lib/HTTP/Request/Common.pm?rev=11055&op=diff
==============================================================================
--- trunk/libwww-perl/lib/HTTP/Request/Common.pm (original)
+++ trunk/libwww-perl/lib/HTTP/Request/Common.pm Sun Dec 9 10:17:57 2007
@@ -1,4 +1,4 @@
-# $Id: Common.pm,v 1.26 2004/11/15 14:52:37 gisle Exp $
+# $Id: Common.pm,v 1.28 2007/07/19 20:46:48 gisle Exp $
#
package HTTP::Request::Common;
@@ -15,7 +15,7 @@
require HTTP::Request;
use Carp();
-$VERSION = sprintf("%d.%02d", q$Revision: 1.26 $ =~ /(\d+)\.(\d+)/);
+$VERSION = sprintf("%d.%02d", q$Revision: 1.28 $ =~ /(\d+)\.(\d+)/);
my $CRLF = "\015\012"; # "\r\n" is not portable
@@ -343,6 +343,12 @@
Like GET() but the method in the request is "PUT".
+The content of the request can be specified using the "Content"
+pseudo-header. This steals a bit of the header field namespace as
+there is no way to directly specify a header that is actually called
+"Content". If you really need this you must update the request
+returned in a separate statement.
+
=item POST $url
=item POST $url, Header => Value,...
@@ -351,10 +357,16 @@
=item POST $url, Header => Value,..., Content => $form_ref
-This works mostly like GET() with "POST" as the method, but this function
-also takes a second optional array or hash reference parameter
-($form_ref). This argument can be used to pass key/value pairs for
-the form content. By default we will initialize a request using the
+=item POST $url, Header => Value,..., Content => $content
+
+This works mostly like PUT() with "POST" as the method, but this
+function also takes a second optional array or hash reference
+parameter $form_ref. As for PUT() the content can also be specified
+directly using the "Content" pseudo-header, and you may also provide
+the $form_ref this way.
+
+The $form_ref argument can be used to pass key/value pairs for the
+form content. By default we will initialize a request using the
C<application/x-www-form-urlencoded> content type. This means that
you can emulate a HTML E<lt>form> POSTing like this:
@@ -422,24 +434,24 @@
--6G+f
Content-Disposition: form-data; name="name"
-
+
Gisle Aas
--6G+f
Content-Disposition: form-data; name="email"
-
+
gisle at aas.no
--6G+f
Content-Disposition: form-data; name="gender"
-
+
M
--6G+f
Content-Disposition: form-data; name="born"
-
+
1964
--6G+f
Content-Disposition: form-data; name="init"; filename=".profile"
Content-Type: text/plain
-
+
PATH=/local/perl/bin:$PATH
export PATH
Modified: trunk/libwww-perl/lib/LWP.pm
URL: http://svn.debian.org/wsvn/trunk/libwww-perl/lib/LWP.pm?rev=11055&op=diff
==============================================================================
--- trunk/libwww-perl/lib/LWP.pm (original)
+++ trunk/libwww-perl/lib/LWP.pm Sun Dec 9 10:17:57 2007
@@ -1,9 +1,9 @@
#
-# $Id: LWP.pm,v 1.149 2005/12/08 12:06:22 gisle Exp $
+# $Id: LWP.pm,v 1.152 2007/08/05 13:23:32 gisle Exp $
package LWP;
-$VERSION = "5.805";
+$VERSION = "5.808";
sub Version { $VERSION; }
require 5.005;
Modified: trunk/libwww-perl/lib/LWP/MediaTypes.pm
URL: http://svn.debian.org/wsvn/trunk/libwww-perl/lib/LWP/MediaTypes.pm?rev=11055&op=diff
==============================================================================
--- trunk/libwww-perl/lib/LWP/MediaTypes.pm (original)
+++ trunk/libwww-perl/lib/LWP/MediaTypes.pm Sun Dec 9 10:17:57 2007
@@ -1,12 +1,12 @@
package LWP::MediaTypes;
-# $Id: MediaTypes.pm,v 1.32 2004/11/17 11:04:09 gisle Exp $
+# $Id: MediaTypes.pm,v 1.33 2007/07/19 20:26:11 gisle Exp $
require Exporter;
@ISA = qw(Exporter);
@EXPORT = qw(guess_media_type media_suffix);
@EXPORT_OK = qw(add_type add_encoding read_media_types);
-$VERSION = sprintf("%d.%02d", q$Revision: 1.32 $ =~ /(\d+)\.(\d+)/);
+$VERSION = sprintf("%d.%02d", q$Revision: 1.33 $ =~ /(\d+)\.(\d+)/);
require LWP::Debug;
use strict;
@@ -19,6 +19,7 @@
'html' => 'text/html',
'gif' => 'image/gif',
'jpg' => 'image/jpeg',
+ 'xml' => 'text/xml',
);
my %suffixExt = (
@@ -26,6 +27,7 @@
'text/html' => 'html',
'image/gif' => 'gif',
'image/jpeg' => 'jpg',
+ 'text/xml' => 'xml',
);
#XXX: there should be some way to define this in the media.types files.
Modified: trunk/libwww-perl/lib/LWP/Protocol.pm
URL: http://svn.debian.org/wsvn/trunk/libwww-perl/lib/LWP/Protocol.pm?rev=11055&op=diff
==============================================================================
--- trunk/libwww-perl/lib/LWP/Protocol.pm (original)
+++ trunk/libwww-perl/lib/LWP/Protocol.pm Sun Dec 9 10:17:57 2007
@@ -1,10 +1,10 @@
package LWP::Protocol;
-# $Id: Protocol.pm,v 1.43 2004/11/12 13:34:10 gisle Exp $
+# $Id: Protocol.pm,v 1.46 2007/07/19 20:26:11 gisle Exp $
require LWP::MemberMixin;
@ISA = qw(LWP::MemberMixin);
-$VERSION = sprintf("%d.%02d", q$Revision: 1.43 $ =~ /(\d+)\.(\d+)/);
+$VERSION = sprintf("%d.%02d", q$Revision: 1.46 $ =~ /(\d+)\.(\d+)/);
use strict;
use Carp ();
@@ -98,14 +98,16 @@
{
my ($self, $arg, $response, $collector) = @_;
my $content;
- my($parse_head, $max_size) = @{$self}{qw(parse_head max_size)};
+ my($ua, $parse_head, $max_size) = @{$self}{qw(ua parse_head max_size)};
my $parser;
if ($parse_head && $response->content_type eq 'text/html') {
require HTML::HeadParser;
$parser = HTML::HeadParser->new($response->{'_headers'});
+ $parser->utf8_mode(1) if $] >= 5.008 && $HTML::Parser::VERSION >= 3.40;
}
my $content_size = 0;
+ my $length = $response->content_length;
if (!defined($arg) || !$response->is_success) {
# scalar
@@ -116,11 +118,10 @@
LWP::Debug::debug("read " . length($$content) . " bytes");
$response->add_content($$content);
$content_size += length($$content);
+ $ua->progress(($length ? ($content_size / $length) : "tick"), $response);
if (defined($max_size) && $content_size > $max_size) {
LWP::Debug::debug("Aborting because size limit exceeded");
$response->push_header("Client-Aborted", "max_size");
- #my $tot = $response->header("Content-Length") || 0;
- #$response->header("X-Content-Range", "bytes 0-$content_size/$tot");
last;
}
}
@@ -139,11 +140,10 @@
LWP::Debug::debug("read " . length($$content) . " bytes");
print OUT $$content or die "Can't write to '$arg': $!";
$content_size += length($$content);
+ $ua->progress(($length ? ($content_size / $length) : "tick"), $response);
if (defined($max_size) && $content_size > $max_size) {
LWP::Debug::debug("Aborting because size limit exceeded");
$response->push_header("Client-Aborted", "max_size");
- #my $tot = $response->header("Content-Length") || 0;
- #$response->header("X-Content-Range", "bytes 0-$content_size/$tot");
last;
}
}
@@ -165,6 +165,8 @@
$response->push_header("Client-Aborted", "die");
last;
}
+ $content_size += length($$content);
+ $ua->progress(($length ? ($content_size / $length) : "tick"), $response);
}
}
else {
Modified: trunk/libwww-perl/lib/LWP/Protocol/https10.pm
URL: http://svn.debian.org/wsvn/trunk/libwww-perl/lib/LWP/Protocol/https10.pm?rev=11055&op=diff
==============================================================================
--- trunk/libwww-perl/lib/LWP/Protocol/https10.pm (original)
+++ trunk/libwww-perl/lib/LWP/Protocol/https10.pm Sun Dec 9 10:17:57 2007
@@ -1,5 +1,5 @@
#
-# $Id: https10.pm,v 1.2 2003/10/23 19:11:33 uid39246 Exp $
+# $Id: https10.pm,v 1.4 2007/07/20 06:16:58 gisle Exp $
use strict;
@@ -7,7 +7,10 @@
# Figure out which SSL implementation to use
use vars qw($SSL_CLASS);
-if ($IO::Socket::SSL::VERSION) {
+if ($Net::SSL::VERSION) {
+ $SSL_CLASS = "Net::SSL";
+}
+elsif ($IO::Socket::SSL::VERSION) {
$SSL_CLASS = "IO::Socket::SSL"; # it was already loaded
}
else {
Modified: trunk/libwww-perl/lib/LWP/Protocol/nntp.pm
URL: http://svn.debian.org/wsvn/trunk/libwww-perl/lib/LWP/Protocol/nntp.pm?rev=11055&op=diff
==============================================================================
--- trunk/libwww-perl/lib/LWP/Protocol/nntp.pm (original)
+++ trunk/libwww-perl/lib/LWP/Protocol/nntp.pm Sun Dec 9 10:17:57 2007
@@ -1,5 +1,5 @@
#
-# $Id: nntp.pm,v 1.10 2005/10/31 15:10:33 gisle Exp $
+# $Id: nntp.pm,v 1.11 2007/07/19 20:26:11 gisle Exp $
# Implementation of the Network News Transfer Protocol (RFC 977)
#
@@ -116,6 +116,7 @@
# Parse headers
my($key, $val);
+ local $_;
while ($_ = shift @$art) {
if (/^\s+$/) {
last; # end of headers
Modified: trunk/libwww-perl/lib/LWP/UserAgent.pm
URL: http://svn.debian.org/wsvn/trunk/libwww-perl/lib/LWP/UserAgent.pm?rev=11055&op=diff
==============================================================================
--- trunk/libwww-perl/lib/LWP/UserAgent.pm (original)
+++ trunk/libwww-perl/lib/LWP/UserAgent.pm Sun Dec 9 10:17:57 2007
@@ -1,13 +1,13 @@
package LWP::UserAgent;
-# $Id: UserAgent.pm,v 2.33 2004/09/16 09:28:22 gisle Exp $
+# $Id: UserAgent.pm,v 2.36 2006/06/05 08:36:37 gisle Exp $
use strict;
use vars qw(@ISA $VERSION);
require LWP::MemberMixin;
@ISA = qw(LWP::MemberMixin);
-$VERSION = sprintf("%d.%03d", q$Revision: 2.33 $ =~ /(\d+)\.(\d+)/);
+$VERSION = sprintf("%d.%03d", q$Revision: 2.36 $ =~ /(\d+)\.(\d+)/);
use HTTP::Request ();
use HTTP::Response ();
@@ -209,6 +209,7 @@
@{$self}{qw(timeout cookie_jar use_eval parse_head max_size)};
my $response;
+ $self->progress("begin");
if ($use_eval) {
# we eval, and turn dies into responses below
eval {
@@ -231,6 +232,8 @@
$response->request($request); # record request for reference
$cookie_jar->extract_cookies($response) if $cookie_jar;
$response->header("Client-Date" => HTTP::Date::time2str(time));
+
+ $self->progress("end", $response);
return $response;
}
@@ -423,7 +426,7 @@
sub post {
require HTTP::Request::Common;
my($self, @parameters) = @_;
- my @suff = $self->_process_colonic_headers(\@parameters,2);
+ my @suff = $self->_process_colonic_headers(\@parameters, (ref($parameters[1]) ? 2 : 1));
return $self->request( HTTP::Request::Common::POST( @parameters ), @suff );
}
@@ -483,6 +486,11 @@
return unless defined $arg;
return $arg, $size if defined $size;
return $arg;
+}
+
+sub progress {
+ my($self, $status, $response) = @_;
+ # subclasses might override this
}
@@ -1210,6 +1218,12 @@
=item $ua->post( $url, \%form, $field_name => $value, ... )
+=item $ua->post( $url, $field_name => $value,... Content => \%form )
+
+=item $ua->post( $url, $field_name => $value,... Content => \@form )
+
+=item $ua->post( $url, $field_name => $value,... Content => $content )
+
This method will dispatch a C<POST> request on the given $url, with
%form or @form providing the key/value pairs for the fill-in form
content. Additional headers and content options are the same as for
@@ -1339,6 +1353,15 @@
The base implementation simply checks a set of pre-stored member
variables, set up with the credentials() method.
+=item $ua->progress( $status, $response )
+
+This is called frequently as the response is received regardless of
+how the content is processed. The method is called with $status
+"begin" at the start of processing the request and with $state "end"
+before the request method returns. In between these $status will be
+the fraction of the response currently received or the string "tick"
+if the fraction can't be calculated.
+
=back
=head1 SEE ALSO
Modified: trunk/libwww-perl/lib/Net/HTTPS.pm
URL: http://svn.debian.org/wsvn/trunk/libwww-perl/lib/Net/HTTPS.pm?rev=11055&op=diff
==============================================================================
--- trunk/libwww-perl/lib/Net/HTTPS.pm (original)
+++ trunk/libwww-perl/lib/Net/HTTPS.pm Sun Dec 9 10:17:57 2007
@@ -1,6 +1,6 @@
package Net::HTTPS;
-# $Id: HTTPS.pm,v 1.3 2002/12/23 18:16:29 gisle Exp $
+# $Id: HTTPS.pm,v 1.4 2007/07/19 20:26:11 gisle Exp $
use strict;
use vars qw($VERSION $SSL_SOCKET_CLASS @ISA);
@@ -8,7 +8,10 @@
$VERSION = "1.00";
# Figure out which SSL implementation to use
-if ($IO::Socket::SSL::VERSION) {
+if ($Net::SSL::VERSION) {
+ $SSL_SOCKET_CLASS = "Net::SSL";
+}
+elsif ($IO::Socket::SSL::VERSION) {
$SSL_SOCKET_CLASS = "IO::Socket::SSL"; # it was already loaded
}
else {
Modified: trunk/libwww-perl/t/base/message.t
URL: http://svn.debian.org/wsvn/trunk/libwww-perl/t/base/message.t?rev=11055&op=diff
==============================================================================
--- trunk/libwww-perl/t/base/message.t (original)
+++ trunk/libwww-perl/t/base/message.t Sun Dec 9 10:17:57 2007
@@ -6,6 +6,7 @@
plan tests => 95;
require HTTP::Message;
+require Config;
my($m, $m2, @parts);
@@ -339,7 +340,8 @@
$m->content("H4sICFWAq0ECA3h4eAB7v3u/R6ZCSUZqUarCoxm7uAAZKHXiEAAAAA==\n");
$@ = "";
-skip($] < 5.008 ? "No Encode module" : "",
+skip($] < 5.008 || ($Config::Config{'extensions'} !~ /\bEncode\b/)
+ ? "No Encode module" : "",
sub { eval { $m->decoded_content } }, "\x{FEFF}Hi there \x{263A}\n");
ok($@ || "", "");
ok($m->content, "H4sICFWAq0ECA3h4eAB7v3u/R6ZCSUZqUarCoxm7uAAZKHXiEAAAAA==\n");
@@ -348,7 +350,8 @@
$m->content($tmp);
$m->header("Content-Encoding", "gzip");
$@ = "";
-skip($] < 5.008 ? "No Encode module" : "",
+skip($] < 5.008 || ($Config::Config{'extensions'} !~ /\bEncode\b/)
+ ? "No Encode module" : "",
sub { eval { $m->decoded_content } }, "\x{FEFF}Hi there \x{263A}\n");
ok($@ || "", "");
ok($m->content, $tmp);
Modified: trunk/libwww-perl/t/local/http-get.t
URL: http://svn.debian.org/wsvn/trunk/libwww-perl/t/local/http-get.t?rev=11055&op=diff
==============================================================================
--- trunk/libwww-perl/t/local/http-get.t (original)
+++ trunk/libwww-perl/t/local/http-get.t Sun Dec 9 10:17:57 2007
@@ -50,7 +50,7 @@
open(DAEMON, "$perl local/http-get.t daemon |") or die "Can't exec daemon: $!";
}
-print "1..20\n";
+print "1..21\n";
my $greeting = <DAEMON>;
@@ -384,6 +384,28 @@
}
+{
+
+my $content;
+
+$res = $ua->post(
+ url("/echo/foo", $base),
+ Content_Type => 'text/plain',
+ Content => "Plain Text",
+ ':content_cb' => sub { $content .= $_[0]; return; },
+);
+
+$_ = $content;
+print "not " unless $res->is_success
+ and /^Content-Length:\s*10$/mi
+ and /^Content-Type:\s*text\/plain$/mi
+ and /^Plain Text$/m
+ and ! $res->content
+;
+print "ok 20\n";
+
+}
+
#----------------------------------------------------------------
print "#------------Testing: Terminating server...\n";
sub httpd_get_quit
@@ -396,5 +418,5 @@
$res = $ua->get( url("/quit", $base) );
print "not " unless $res->code == 503 and $res->content =~ /Bye, bye/;
-print "ok 20\n";
-
+print "ok 21\n";
+
Modified: trunk/libwww-perl/talk-to-ourself
URL: http://svn.debian.org/wsvn/trunk/libwww-perl/talk-to-ourself?rev=11055&op=diff
==============================================================================
--- trunk/libwww-perl/talk-to-ourself (original)
+++ trunk/libwww-perl/talk-to-ourself Sun Dec 9 10:17:57 2007
@@ -1,7 +1,7 @@
#!perl -w
# This program check if we are able to talk to ourself. Misconfigured
-# systems that can't talk to their own 'hostname' has the most commonly
+# systems that can't talk to their own 'hostname' was the most commonly
# reported libwww-failure.
use strict;
More information about the Pkg-perl-cvs-commits
mailing list