Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: RFC: Code testers/reviewers needed

by vsespb (Hermit)
on Jun 07, 2013 at 08:49 UTC ( #1037632=note: print w/ replies, xml ) Need Help??


in reply to RFC: Code testers/reviewers needed

1. $header->content_length is not available for chunked transfer (according to HTTP spec)
2. why are you mixing decoded_content and content_file ?
3. you are not checking if file downloaded correct (see mirror method in LWP::UserAgent)
4. is_success can give you false positives (but probably HEAD requests are OK in practice) https://github.com/libwww-perl/libwww-perl/issues/46 https://rt.cpan.org/Public/Bug/Display.html?id=85759
5. you can avoid HEAD requests at all - use LWP callbacks, you will be able to get length/last_mod_time before whole file is transferred


Comment on Re: RFC: Code testers/reviewers needed
Re^2: RFC: Code testers/reviewers needed
by AI Cowboy (Sexton) on Jun 07, 2013 at 22:24 UTC
    All your points are good, I'll look into LWP callbacks so I can avoid HEAD requests - the mixing of decoded_content and content_file was due to me misunderstanding what decoded_content did. Can you elaborate what it does a little bit, for me?
      Documentation for decoded_content: http://search.cpan.org/perldoc?HTTP%3A%3AMessage Note that there is no content at all, as file downloaded using content_file option.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1037632]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (7)
As of 2014-08-01 07:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (257 votes), past polls