[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl-Modules] Another nasty problem?



At 11:30 AM +0900 4/20/00, KIMURA Takeshi wrote:
>I guess I am working on too many things at a time. I forgot what I
>did yesterday.
>
>I had a simple test script which might spot the problem.
>
>require LWP::UserAgent;
>$ua = new LWP::UserAgent;
>$request = new HTTP::Request( 'GET', 'file:///Macintosh%20HD/a' );
>$response = $ua->request($request, 'tmp');
>print $response->as_string(), "\n";
>
>This crashes MacPerl (and eventually the OS) although there is file '
>a' on 'Macintosh HD.'

Usually when MacPerl crashes when you're using modules, it's because 
you haven't given enough memory to MacPerl.  You need far more than 
the default if you use almost any module.  Certainly that's the case 
with something the size of LWP.  My memory allocation for MacPerl is 
set to 40 Mb.

But there does seem to be a problem:  If I take your script and 
modify it slightly to point to a file that exists on my disk, it 
converts the file URL to a relative path:

404 (Not Found) File `:Portable Bunny:Game Sprockets Readme' does not exist
Client-Date: Thu, 20 Apr 2000 12:11:32 GMT

To fix that, just removing one of the slashes seems to do it 
(file://Portable...):

200 (OK)

Content-Length: 3394
Content-Type: text/plain
Last-Modified: Tue, 14 Dec 1999 16:00:00 GMT
Client-Date: Thu, 20 Apr 2000 12:12:38 GMT

I'll look into this and see if a patch needs to be sent to Gisle Aas. 
IIRC, there was a change to the file URL syntax where the thing after 
the // is a volume name, in which case it seems to me that // rather 
than /// is the preferred syntax, anyway.

But otherwise, I'm not seeing any crashing, and MacPerl's memory 
usage is not a problem.  I'm running 9.0.4 on an iBook.


>
>
>KIMURA Takeshi wrote on 00.4.20 9:11 AM:
>>I had a module derived from pure Perl HTML::Parser and struggled a
>>while making it work under XS version.  With a help from lwp list, I
>>have a new new subroutine and everything started to work fine.
>>
>>Now, I have a different problem.
>>
>>Inside my module there is a LWP::UserAgent instance and it fetches
>>some file according to the URL passed to it.
>>
>>It seems ok with 'http://...' but not with 'file:///...'
>>
>>Sometimes it does work, but another time not.
>>
>>It starts ToolServer application and crashes me into MacsBug.
>>
>>Any clue figuring out where the problem is?
>>Where should I start my investigation?
>
>
>--
>Takeshi
>
-- 
--
Paul Schinder
schinder@pobox.com

==== Want to unsubscribe from this list?
==== Send mail with body "unsubscribe" to macperl-modules-request@macperl.org