Opened 10 years ago

Closed 10 years ago

#14 closed bug (fixed)

Use LWP instead of wget

Reported by: Vincent Caron Owned by: Lucas Bonnet
Priority: major Component: Bearmail
Keywords: Cc:

Description

Invocations of wget are not really Perlish, LWP has been around for so long that it's ubiquitous. And it should be faster too, especially if the same UA can be reused for all requests since they look all targeted to the same host.

And the current wget invocation fails on quoting spaces and shell metacharacaters:

`wget -q $doc_url -O design_$1`;

Should be at least:

system('wget', '-q', $doc_url, '-O', "design_$1");

Or better:

Use LWP::Simple;
$LWP::Simple::ua->agent('couchdb-dump/0.3');

# Later...
my $http_status = getstore($doc_url, "design_$1");

Change History (2)

comment:1 Changed 10 years ago by Lucas Bonnet

Agreed. The goal was a) to have a working solution very fast and b) to have a solution that could dump large documents without hogging memory.

I'll rework using LWP.

comment:2 Changed 10 years ago by lucas

Resolution: fixed
Status: newclosed

(In [493]) couch-dump: use LWP::Simple instead of system(wget) (closes #14)

Note: See TracTickets for help on using tickets.