Balazs Rauznitz <[EMAIL PROTECTED]> writes:
> I was happily using the libwww-perl/5.45 package to grab password
> protected files, but the same stuff doesn't work with libwww-perl/5.47
>
> I know there were changed between LWP::UserAgent 1.62 to 1.64, but it
> seemed to change once more. The code I have is:
> (in{fromserver} is just a server name...)
>
> $netloc = ( ($in{fromserver} =~ /:/) or ($LWP::VERSION <= 5.15) ) ?
> $in{fromserver} : $in{fromserver} . ":80";
>
> It doesn't even work with adding:
>
> $netloc = "http://" . $netloc;
>
> what has changed between the two distributions ? 5.47 comes with RedHat
> 6.1, so if anyone had done it with that I'd appreciate some sample code.
I can't see that anything have changed that should matter to you.
This is the complete diff.
Regards,
Gisle
$ cd lwp
$ cvs diff -u -rR5_45 -rR5_47
Index: ChangeLog
===================================================================
RCS file: /home/cvs/aas/perl/mods/libwww-perl/ChangeLog,v
retrieving revision 1.101
retrieving revision 1.103
diff -u -p -u -r1.101 -r1.103
--- ChangeLog 1999/09/20 13:25:06 1.101
+++ ChangeLog 1999/11/16 14:46:40 1.103
@@ -1,3 +1,37 @@
+1999-11-16 Gisle Aas <[EMAIL PROTECTED]>
+
+ o Release 5.47
+
+ o Added HTML::Form to the distribution.
+
+ o LWP::Protocol::ftp: Make it URI.pm compatible. We broke it in 5.45.
+
+ o LWP::Protocol::http: Kill any Connection header
+
+ o LWP::MediaTypes: Fixed builtin html/text mapping.
+ Added bz2 to suffixEncoding
+
+
+
+1999-10-28 Gisle Aas <[EMAIL PROTECTED]>
+
+ o Release 5.46
+
+ o Updated mailing list address
+
+ o Avoid warnings for lwp-request -t
+
+ o referrer as alternative spelling for referer as suggested by tchrist.
+
+ o More conservative selection of boundary for multipart messages
+ in &HTTP::Request::Common::POST.
+
+ o LWP::MediaTypes can now export &read_media_types.
+
+ o Spelling corrections from Ben Tilly <[EMAIL PROTECTED]>
+
+
+
1999-09-20 Gisle Aas <[EMAIL PROTECTED]>
o Release 5.45
Index: MANIFEST
===================================================================
RCS file: /home/cvs/aas/perl/mods/libwww-perl/MANIFEST,v
retrieving revision 1.71
retrieving revision 1.72
diff -u -p -u -r1.71 -r1.72
--- MANIFEST 1999/09/20 12:59:22 1.71
+++ MANIFEST 1999/11/16 14:12:33 1.72
@@ -11,6 +11,7 @@ bin/lwp-rget.PL Writes bin/lwp-rget sc
lwpcook.pod Libwww-perl examples
lib/Bundle/LWP.pm Defines prereq modules
lib/File/Listing.pm Parse directory listings
+lib/HTML/Form.pm Parse <form>...</form>
lib/HTTP/Cookies.pm Cookie storage and management
lib/HTTP/Daemon.pm A simple httpd
lib/HTTP/Date.pm Date conversion routines
@@ -60,6 +61,7 @@ t/base/message.t Test HTTP::Request/HTT
t/base/negotiate.t Test HTTP::Negotiation module
t/base/response.t Test additional HTTP::Response methods
t/base/status.t Test HTTP::Status module
+t/html/form.t Test HTML::Form module
t/local/autoload.t Test autoloading of LWP::Protocol modules
t/local/get.t Try to get a local file
t/local/http.t Test http to local server
Index: README
===================================================================
RCS file: /home/cvs/aas/perl/mods/libwww-perl/README,v
retrieving revision 1.47
retrieving revision 1.48
diff -u -p -u -r1.47 -r1.48
--- README 1999/09/20 13:14:23 1.47
+++ README 1999/10/20 18:13:09 1.48
@@ -93,13 +93,13 @@ SUPPORT
Questions about how to use this library should be directed to the
comp.lang.perl.modules USENET Newsgroup. Bug reports and suggestions
-for improvements can be sent to the <[EMAIL PROTECTED]> mailing
+for improvements can be sent to the <[EMAIL PROTECTED]> mailing
list. This mailing list is also the place for general discussions and
development of the libwww-perl package.
You can join the mailing list by sending a message to
-<[EMAIL PROTECTED]> with "Subscribe" as subject.
- ^^^^^^^^
+<[EMAIL PROTECTED]> with "subscribe" as subject.
+ ^^^^^^^^
AVAILABILITY
Index: bin/lwp-request.PL
===================================================================
RCS file: /home/cvs/aas/perl/mods/libwww-perl/bin/lwp-request.PL,v
retrieving revision 1.38
retrieving revision 1.39
diff -u -p -u -r1.38 -r1.39
--- bin/lwp-request.PL 1999/06/01 10:40:51 1.38
+++ bin/lwp-request.PL 1999/10/28 12:13:21 1.39
@@ -12,7 +12,7 @@ $Config{'startperl'} -w
!GROK!THIS!
print OUT <<'!NO!SUBS!';
-# $Id: lwp-request.PL,v 1.38 1999/06/01 10:40:51 gisle Exp $
+# $Id: lwp-request.PL,v 1.39 1999/10/28 12:13:21 gisle Exp $
#
# Simple user agent using LWP library.
@@ -190,7 +190,7 @@ $progname = $0;
$progname =~ s,.*/,,; # use basename only
$progname =~ s/\.\w*$//; # strip extension, if any
-$VERSION = sprintf("%d.%02d", q$Revision: 1.38 $ =~ /(\d+)\.(\d+)/);
+$VERSION = sprintf("%d.%02d", q$Revision: 1.39 $ =~ /(\d+)\.(\d+)/);
require LWP;
@@ -340,8 +340,10 @@ if (defined $options{'t'}) {
$options{'t'} =~ /^(\d+)([smh])?/;
die "$progname: Illegal timeout value!\n" unless defined $1;
$timeout = $1;
- $timeout *= 60 if ($2 eq "m");
- $timeout *= 3600 if ($2 eq "h");
+ if (defined $2) {
+ $timeout *= 60 if $2 eq "m";
+ $timeout *= 3600 if $2 eq "h";
+ }
$ua->timeout($timeout);
}
Index: lib/LWP.pm
===================================================================
RCS file: /home/cvs/aas/perl/mods/libwww-perl/lib/LWP.pm,v
retrieving revision 1.90
retrieving revision 1.92
diff -u -p -u -r1.90 -r1.92
--- lib/LWP.pm 1999/09/20 13:25:36 1.90
+++ lib/LWP.pm 1999/11/16 14:16:01 1.92
@@ -1,9 +1,9 @@
#
-# $Id: LWP.pm,v 1.90 1999/09/20 13:25:36 gisle Exp $
+# $Id: LWP.pm,v 1.92 1999/11/16 14:16:01 gisle Exp $
package LWP;
-$VERSION = "5.45";
+$VERSION = "5.47";
sub Version { $VERSION; }
require 5.004;
@@ -492,7 +492,7 @@ The "To" header is initialized from the
Example:
- $req = HTTP::Request->new(POST => 'mailto:[EMAIL PROTECTED]');
+ $req = HTTP::Request->new(POST => 'mailto:[EMAIL PROTECTED]');
$req->header(Subject => "subscribe");
$req->content("Please subscribe me to the libwww-perl mailing list!\n");
@@ -575,11 +575,12 @@ modify it under the same terms as Perl i
=head1 AVAILABILITY
-The latest version of this library is likely to be available from:
+The latest version of this library is likely to be available from CPAN
+as well as:
- http://www.sn.no/libwww-perl/
+ http://www.linpro.no/lwp/
-The best place to discuss this code is on the
-<[EMAIL PROTECTED]> mailing list.
+The best place to discuss this code is on the <[EMAIL PROTECTED]>
+mailing list.
=cut
Index: lib/HTTP/Headers.pm
===================================================================
RCS file: /home/cvs/aas/perl/mods/libwww-perl/lib/HTTP/Headers.pm,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -p -u -r1.36 -r1.37
--- lib/HTTP/Headers.pm 1998/04/10 14:51:22 1.36
+++ lib/HTTP/Headers.pm 1999/10/28 12:09:12 1.37
@@ -1,5 +1,5 @@
#
-# $Id: Headers.pm,v 1.36 1998/04/10 14:51:22 aas Exp $
+# $Id: Headers.pm,v 1.37 1999/10/28 12:09:12 gisle Exp $
package HTTP::Headers;
@@ -30,7 +30,7 @@ The following methods are available:
use strict;
use vars qw($VERSION $TRANSLATE_UNDERSCORE);
-$VERSION = sprintf("%d.%02d", q$Revision: 1.36 $ =~ /(\d+)\.(\d+)/);
+$VERSION = sprintf("%d.%02d", q$Revision: 1.37 $ =~ /(\d+)\.(\d+)/);
use Carp ();
@@ -508,6 +508,7 @@ sub server { (shift->_header(
sub from { (shift->_header('From', @_))[0] }
sub referer { (shift->_header('Referer', @_))[0] }
sub warning { (shift->_header('Warning', @_))[0] }
+*referrer = \&referer; # on tchrist's request
sub www_authenticate { (shift->_header('WWW-Authenticate', @_))[0] }
sub authorization { (shift->_header('Authorization', @_))[0] }
Index: lib/HTTP/Request/Common.pm
===================================================================
RCS file: /home/cvs/aas/perl/mods/libwww-perl/lib/HTTP/Request/Common.pm,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -p -u -r1.15 -r1.16
--- lib/HTTP/Request/Common.pm 1999/03/20 07:37:36 1.15
+++ lib/HTTP/Request/Common.pm 1999/10/28 11:49:02 1.16
@@ -1,4 +1,4 @@
-# $Id: Common.pm,v 1.15 1999/03/20 07:37:36 gisle Exp $
+# $Id: Common.pm,v 1.16 1999/10/28 11:49:02 gisle Exp $
#
package HTTP::Request::Common;
@@ -15,7 +15,7 @@ require Exporter;
require HTTP::Request;
use Carp();
-$VERSION = sprintf("%d.%02d", q$Revision: 1.15 $ =~ /(\d+)\.(\d+)/);
+$VERSION = sprintf("%d.%02d", q$Revision: 1.16 $ =~ /(\d+)\.(\d+)/);
my $CRLF = "\015\012"; # "\r\n" is not portable
@@ -189,9 +189,8 @@ sub form_data # RFC1867
CHECK_BOUNDARY:
{
for (@parts) {
- if (index($_, "--$boundary") >= 0) {
+ if (index($_, $boundary) >= 0) {
# must have a better boundary
- #warn "Need something better that '$boundary' as boundary\n";
$boundary = boundary(++$bno);
redo CHECK_BOUNDARY;
}
@@ -209,7 +208,7 @@ sub form_data # RFC1867
sub boundary
{
- my $size = shift || return "000";
+ my $size = shift || return "xYzZY";
require MIME::Base64;
my $b = MIME::Base64::encode(join("", map chr(rand(256)), 1..$size*3), "");
$b =~ s/[\W]/X/g; # ensure alnum only
Index: lib/LWP/MediaTypes.pm
===================================================================
RCS file: /home/cvs/aas/perl/mods/libwww-perl/lib/LWP/MediaTypes.pm,v
retrieving revision 1.25
retrieving revision 1.27
diff -u -p -u -r1.25 -r1.27
--- lib/LWP/MediaTypes.pm 1999/03/20 07:37:36 1.25
+++ lib/LWP/MediaTypes.pm 1999/11/16 14:36:24 1.27
@@ -1,5 +1,5 @@
#
-# $Id: MediaTypes.pm,v 1.25 1999/03/20 07:37:36 gisle Exp $
+# $Id: MediaTypes.pm,v 1.27 1999/11/16 14:36:24 gisle Exp $
package LWP::MediaTypes;
@@ -31,8 +31,8 @@ The following functions are exported by
require Exporter;
@ISA = qw(Exporter);
@EXPORT = qw(guess_media_type media_suffix);
-@EXPORT_OK = qw(add_type add_encoding);
-$VERSION = sprintf("%d.%02d", q$Revision: 1.25 $ =~ /(\d+)\.(\d+)/);
+@EXPORT_OK = qw(add_type add_encoding read_media_types);
+$VERSION = sprintf("%d.%02d", q$Revision: 1.27 $ =~ /(\d+)\.(\d+)/);
require LWP::Debug;
use strict;
@@ -49,7 +49,7 @@ my %suffixType = (
my %suffixExt = (
'text/plain' => 'txt',
- 'text/html' => 'h',
+ 'text/html' => 'html',
'image/gif' => 'gif',
'image/jpeg' => 'jpg',
);
@@ -60,7 +60,8 @@ my %suffixEncoding = (
'gz' => 'gzip',
'hqx' => 'x-hqx',
'uu' => 'x-uuencode',
- 'z' => 'x-pack'
+ 'z' => 'x-pack',
+ 'bz2' => 'x-bzip2',
);
sub _dump {
Index: lib/LWP/UserAgent.pm
===================================================================
RCS file: /home/cvs/aas/perl/mods/libwww-perl/lib/LWP/UserAgent.pm,v
retrieving revision 1.68
retrieving revision 1.69
diff -u -p -u -r1.68 -r1.69
--- lib/LWP/UserAgent.pm 1999/08/02 22:57:09 1.68
+++ lib/LWP/UserAgent.pm 1999/09/21 05:53:30 1.69
@@ -1,4 +1,4 @@
-# $Id: UserAgent.pm,v 1.68 1999/08/02 22:57:09 gisle Exp $
+# $Id: UserAgent.pm,v 1.69 1999/09/21 05:53:30 gisle Exp $
package LWP::UserAgent;
use strict;
@@ -92,7 +92,7 @@ use vars qw(@ISA $VERSION);
require LWP::MemberMixin;
@ISA = qw(LWP::MemberMixin);
-$VERSION = sprintf("%d.%02d", q$Revision: 1.68 $ =~ /(\d+)\.(\d+)/);
+$VERSION = sprintf("%d.%02d", q$Revision: 1.69 $ =~ /(\d+)\.(\d+)/);
use HTTP::Request ();
use HTTP::Response ();
@@ -329,7 +329,7 @@ sub request
if ($@) {
if ($@ =~ /^Can\'t locate/) {
$response->header("Client-Warning" =>
- "Unsupport authentication scheme '$scheme'");
+ "Unsupported authentication scheme '$scheme'");
} else {
$response->header("Client-Warning" => $@);
}
@@ -512,7 +512,7 @@ sub is_protocol_supported
# assume we got a reference to an URI object
$scheme = $scheme->scheme;
} else {
- Carp::croak("Illeal scheme '$scheme' passed to is_protocol_supported")
+ Carp::croak("Illegal scheme '$scheme' passed to is_protocol_supported")
if $scheme =~ /\W/;
$scheme = lc $scheme;
}
@@ -621,11 +621,11 @@ specify proxies like this (sh-syntax):
gopher_proxy=http://proxy.my.place/
wais_proxy=http://proxy.my.place/
- no_proxy="my.place"
+ no_proxy="localhost,my.domain"
export gopher_proxy wais_proxy no_proxy
Csh or tcsh users should use the C<setenv> command to define these
-envirionment variables.
+environment variables.
=cut
Index: lib/LWP/Protocol/ftp.pm
===================================================================
RCS file: /home/cvs/aas/perl/mods/libwww-perl/lib/LWP/Protocol/ftp.pm,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -p -u -r1.26 -r1.27
--- lib/LWP/Protocol/ftp.pm 1999/09/20 13:08:35 1.26
+++ lib/LWP/Protocol/ftp.pm 1999/11/04 20:25:51 1.27
@@ -1,5 +1,5 @@
#
-# $Id: ftp.pm,v 1.26 1999/09/20 13:08:35 gisle Exp $
+# $Id: ftp.pm,v 1.27 1999/11/04 20:25:51 gisle Exp $
# Implementation of the ftp protocol (RFC 959). We let the Net::FTP
# package do all the dirty work.
@@ -112,7 +112,7 @@ sub request
LWP::Debug::debug($ftp->message);
# Get & fix the path
- my @path = grep { length } $url->path_components;
+ my @path = grep { length } $url->path_segments;
my $remote_file = pop(@path);
$remote_file = '' unless defined $remote_file;
Index: lib/LWP/Protocol/http.pm
===================================================================
RCS file: /home/cvs/aas/perl/mods/libwww-perl/lib/LWP/Protocol/http.pm,v
retrieving revision 1.46
retrieving revision 1.47
diff -u -p -u -r1.46 -r1.47
--- lib/LWP/Protocol/http.pm 1999/03/19 22:03:10 1.46
+++ lib/LWP/Protocol/http.pm 1999/11/04 20:31:21 1.47
@@ -1,5 +1,5 @@
#
-# $Id: http.pm,v 1.46 1999/03/19 22:03:10 gisle Exp $
+# $Id: http.pm,v 1.47 1999/11/04 20:31:21 gisle Exp $
package LWP::Protocol::http;
@@ -84,7 +84,7 @@ sub request
# connect to remote site
my $socket = $self->_new_socket($host, $port, $timeout);
$self->_check_sock($request, $socket);
-
+
my $sel = IO::Select->new($socket) if $timeout;
my $request_line = "$method $fullpath HTTP/1.0$CRLF";
@@ -105,13 +105,15 @@ sub request
$h->header('Content-Length' => length $$cont_ref)
if defined($$cont_ref) && length($$cont_ref);
}
-
+
# HTTP/1.1 will require us to send the 'Host' header, so we might
# as well start now.
my $hhost = $url->authority;
$hhost =~ s/^([^\@]*)\@//; # get rid of potential "user:pass@"
$h->header('Host' => $hhost) unless defined $h->header('Host');
+ $h->remove_header('Connection'); # need support here to be useful
+
# add authorization header if we need them. HTTP URLs do
# not really support specification of user and password, but
# we allow it.
@@ -143,7 +145,7 @@ sub request
die "short write" unless $n == length($$cont_ref);
LWP::Debug::conns($buf);
}
-
+
# read response line from server
LWP::Debug::debug('reading response');
Index: t/TEST
===================================================================
RCS file: /home/cvs/aas/perl/mods/libwww-perl/t/TEST,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -p -u -r1.8 -r1.9
--- t/TEST 1998/09/11 10:13:24 1.8
+++ t/TEST 1999/11/16 14:15:32 1.9
@@ -32,7 +32,7 @@ if (@ARGV) {
}
}
} else {
- @tests = (<base/*.t>, <robot/*.t>, <local/*.t>);
+ @tests = (<base/*.t>, <html/*.t>, <robot/*.t>, <local/*.t>);
push(@tests, <net/*.t>) if -f "net/config.pl";
}