in reply to "Unexpected end of stream while looking for line"

Constructor of HTTP::Tiny

sub new { my($class, %args) = @_; my $self = { max_redirect => 5, timeout => 60, # default keep_alive => 1, verify_SSL => $args{verify_SSL} || $args{verify_ssl} || 0, # + no verification by default no_proxy => $ENV{no_proxy}, }; bless $self, $class; $class->_validate_cookie_jar( $args{cookie_jar} ) if $args{cookie_ +jar}; for my $key ( @attributes ) { $self->{$key} = $args{$key} if exists $args{$key} } $self->agent( exists $args{agent} ? $args{agent} : $class->_agent +); $self->_set_proxies; return $self; }

Default request timeout is 60 seconds, why do you put 6000?

6000 sec = 100 minutes = 1 hour 40 :)

Replies are listed 'Best First'.
Re^2: "Unexpected end of stream while looking for line"
by msh210 (Monk) on Jan 08, 2016 at 19:54 UTC
    I put 6000 because I suspected the timeout caused the 599 error. But that was not the case: the response should have come before 100 minutes.

      The remote server could have a front-end proxy with its own timeout limit exceeded by the process preparing the response.


      The way forward always starts with a minimal test.
      With 100 minutes, there is something wrong in the "flow" or "concept".
      You can't put a timeout of 100 minutes because the server should release the request and don't keep variables in memory or cache. The server performance will drop and you can have "server not responding", with the need to recycle or restart the server!
      Imagine you have 20 connections in 100 minutes, all will be kept during this time but there are other timeouts: session timeout, script timeout, execution timeout... and they are different, less...