Commits

Jakub Wilk committed 4532d5b

Read data from the HTTP server in big chunks.

  • Participants
  • Parent commits 028e20b

Comments (0)

Files changed (1)

 my $mbank = undef; # use set_country() to define
 my $cookie_jar_file = './cookie-jar.txt';
 my $config_file = './mbank-cli.conf';
+my $http_read_size_hint = 1 << 20; # 1 MiB
 
 sub set_country($)
 {
   my $subject_regex = qr(/CN=\Q$mbank_host\E$);
   $request->header('If-SSL-Cert-Subject' => $subject_regex);
   debug sprintf('Download <%s %s>', $request->method, $request->uri);
-  my $response = $ua->request($request);
+  my $response = $ua->request($request, undef, $http_read_size_hint);
   http_error $request unless $response->is_success;
   my $content = $response->content;
   $content =~ s/\r//g;