Hello Markus, On Sun, 23 Sep 2012 00:19:38 +0100 "Markus Moeller" <hua...@moeller.plus.com> wrote:
> Hi, > > I have a problem that my perl modules are not anymore downloading a > large file from a https site. It worked with a previoius built, but > since I update all modules via cpan it fails after downloading some > parts. > > I use the following code: > > sub http_transfer { > > my ( $url, $file ) = @_; > > die "Need url and dest_file as params" unless @_ > 1; > > # set the method: > $method ||= "get"; > > log_and_die("I need a URL!") unless ($url); > > # skip certification verification: > my $ua = LWP::UserAgent->new( ssl_opts => { verify_hostname => > 0 }); my $response; > > if ( $method eq "get" ) { > > my $file_dir ||= dirname($file); > unless ( -d $file_dir ) { > make_path $file_dir ; > } > > # set content_file for output, and send the request: > $response = $ua->get($url, ':content_file' => $file ); > > } > if ( $response->is_error ) { > log_and_die( "[" . $response->status_line . "] error trying > to $method $url."); > } > } # end sub _http_transfer > > Your code is not self-contained, and is strange and suffers from bad idioms. Can you please provide a self-contained, reproducing, example that all of us can run? > The platform I run on is Solaris 10 and perl , openssl is compiled > with SUNWspro cc. > Ouch! Do you know if the same code is working fine on an up-to-date Linux distribution? Regards, Shlomi Fish > Any idea how to debug ? When I use truss I see my old perl modules > just read until the end whereas the new modules for some reason get a > read = 0 somewhere at the beginning of the file download. > > Thank you > Markus > > -- ----------------------------------------------------------------- Shlomi Fish http://www.shlomifish.org/ My Public Domain Photos - http://www.flickr.com/photos/shlomif/ Real programmers don’t write workarounds. They tell their users to upgrade their software. Please reply to list if it's a mailing list post - http://shlom.in/reply .