Re: URI::URL - problem in LWP 5.53_95 with mod_perl

2001-08-27 Thread Mike808

___cliff rayman___ wrote:
 i did not use CPAN.pm to install software on this particular
 machine.  my mod_perl builds are always by hand.
 
 i did understand exactly why this happened.  i should have made
 that more clear in my first e-mail.  i made the patch that i did, so
 i would not have the same problem with any other software.

You are correct. I interviewed the sysadmin that called me for help with this
building mod_perl, and he fessed up to FTP'ing into CPAN and just grabbing
the latest version - i.e. the 5.53_95 tarball. He didn't use CPAN.pm
after all.

I couldn't get CPAN.pm to fetch the dev tarball either. I just figured he
was too new to Perl and Solaris (a former MCSE) to grab a tarball and
install. Turns out, he was too new. He just didn't know about CPAN.pm!

Anyway, I missed your (Cliff's) one-line patch to LWP::UserAgent.pm and
thought it was the more extensive earlier patch. My vote is for Cliff's
patch to just 'use URI::URL;' in LWP::UserAgent.pm.

If you don't feel like patching, remember to export 
PERL_HTTP_URI_CLASS=URI::URL instead.

Mike808/
 
 Stas Bekman wrote:
  What version of CPAN.pm are you using? CPAN.pm never picks distros with
  '_' in the version part. I've just performed checking I've got
  5.53.tar.gz.

Then you shouldn't be having the missing URI::URL problem in mod_perl.
Or has the real 5.53 been fubar'd since April or so, and nobody noticed
until now?

Mike808/
-- 
perl -le $_='7284254074:0930970:H4012816';tr[0-][ BOPEN!SMUT];print



Re: URI::URL - problem in LWP 5.53_95 with mod_perl

2001-08-24 Thread mike808

I ran into the same problem. Found a simpler, cleaner solution.
Just perform a

   export PERL_HTTP_URI_CLASS=URI::URL

before building mod_perl, and you're home free.

Long term, all mod_perl testing modules that assume URI::URL 
is loaded by LWP will now need to explicitly load URI::URL if they use it.
I suggest doing so following the loading of LWP.

Here's why it happened:

Cliff noted:
I noticed everywhere that URI::URL  was being used in mod_perl and embperl,
LWP::UserAgent was being used.

also, i found this is the LWP (libwww-perl-5.5395) release notes:

  HTTP::Request, HTTP::Response will by default now use URI class,
  instead of URI::URL, when constructing its URI objects.  This
  has a potential for breaking existing code as URI::URL objects had
  some extra methods that external code might depend upon.

He's right, and this is exactly what's happened in mod_perl.
It's a bug *caused* by recent changes in LWP, and not a bug in LWP, per se.
From Gisle Aas' directory in CPAN, you can see:

04/10/01 06:15PM157,267 libwww-perl-5.53.tar.gz
05/05/01 08:57AM172,925 libwww-perl-5.53_94.tar.gz
08/06/01 07:46PM174,613 libwww-perl-5.53_95.tar.gz

From the official website, http://www.linpro.no/lwp, he says the
lastest version is 5.53 from 4/10/01. However, if you use the CPAN module,
you will pickup the 5.53_95 version instead. This is the version (and
maybe 5.53_94 as well, but I haven't checked) that makes mod_perl break.
Or maybe some interim versions of the CPAN module are downloading
this development version of the module, I'm not sure.

I'm willing to bet that both of you have the later 5.53_95 rev and not
the 5.53 version.

Here's the cause of the problem. Gisle has always used URI::URL for
representing his URLs within LWP. These latest revs changed that.
He now uses a base URI class. The effect of this is that LWP no longer
uses URI::URL. Meaning URI::URL is no longer 'use'd by LWP, and so
LWP will no longer automatically 'use' URI::URL and pull it in too.

This is what's making mod_perl (and any other modules that do this) break.

Using LWP *does not* load URI::URL. mod_perl's tests *assume* that just
because LWP was loaded, that URI::URL was too. And that's the hidden
dependency that's being violated here.

So, where's the root of the cause of the code breakage in LWP, you ask?

Way down in HTTP::Message (which is inherited by HTTP::Request and 
HTTP::Response), Gisle has changed it to use the bare URI class and not
the older URI::URL class.

Here's the line of code that does the damage (Line 37 in HTTP::Message.pm):

   $HTTP::URI_CLASS ||= $ENV{PERL_HTTP_URI_CLASS} || URI;

As should be obvious now, my simple solution is to perform a

   export PERL_HTTP_URI_CLASS=URI::URL

before building mod_perl, and you're home free.

Michael King
[EMAIL PROTECTED]

-
Valuenet Web Mail.
http://www.valuenet.net/