Hello community,
here is the log from the commit of package perl-Mojolicious for
openSUSE:Factory checked in at 2020-04-21 13:08:32
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/perl-Mojolicious (Old)
and /work/SRC/openSUSE:Factory/.perl-Mojolicious.new.2738 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "perl-Mojolicious"
Tue Apr 21 13:08:32 2020 rev:127 rq:795793 version:8.37
Changes:
--------
--- /work/SRC/openSUSE:Factory/perl-Mojolicious/perl-Mojolicious.changes
2020-04-04 12:21:30.091731232 +0200
+++
/work/SRC/openSUSE:Factory/.perl-Mojolicious.new.2738/perl-Mojolicious.changes
2020-04-21 13:08:54.404601608 +0200
@@ -1,0 +2,17 @@
+Mon Apr 20 03:09:02 UTC 2020 - <[email protected]>
+
+- updated to 8.37
+ see /usr/share/doc/packages/perl-Mojolicious/Changes
+
+ 8.37 2020-04-19
+ - Added keep_alive_timeout attribute to Mojo::Server::Daemon.
+ - Added -k options to daemon and prefork commands.
+ - Added keep_alive_timeout setting to Hypnotoad.
+ - Increased various default timeouts because keep_alive_timeout takes over
+ some of their previous responsibility.
+ - Improved timeout setting performance significantly in
Mojo::IOLoop::Stream.
+ - Improved again method in Mojo::Reactor, Mojo::Reactor::EV and
+ Mojo::Reactor::Poll to allow changing the invocation time of active
timers.
+ - Fixed support for 425 status in Mojo::Message::Response.
+
+-------------------------------------------------------------------
Old:
----
Mojolicious-8.36.tar.gz
New:
----
Mojolicious-8.37.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ perl-Mojolicious.spec ++++++
--- /var/tmp/diff_new_pack.Bs5rMx/_old 2020-04-21 13:08:55.324603443 +0200
+++ /var/tmp/diff_new_pack.Bs5rMx/_new 2020-04-21 13:08:55.324603443 +0200
@@ -17,7 +17,7 @@
Name: perl-Mojolicious
-Version: 8.36
+Version: 8.37
Release: 0
%define cpan_name Mojolicious
Summary: Real-time web framework
++++++ Mojolicious-8.36.tar.gz -> Mojolicious-8.37.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Mojolicious-8.36/Changes new/Mojolicious-8.37/Changes
--- old/Mojolicious-8.36/Changes 2020-03-31 18:47:00.000000000 +0200
+++ new/Mojolicious-8.37/Changes 2020-04-19 16:34:05.000000000 +0200
@@ -1,4 +1,15 @@
+8.37 2020-04-19
+ - Added keep_alive_timeout attribute to Mojo::Server::Daemon.
+ - Added -k options to daemon and prefork commands.
+ - Added keep_alive_timeout setting to Hypnotoad.
+ - Increased various default timeouts because keep_alive_timeout takes over
+ some of their previous responsibility.
+ - Improved timeout setting performance significantly in Mojo::IOLoop::Stream.
+ - Improved again method in Mojo::Reactor, Mojo::Reactor::EV and
+ Mojo::Reactor::Poll to allow changing the invocation time of active timers.
+ - Fixed support for 425 status in Mojo::Message::Response.
+
8.36 2020-03-31
- Added handler attribute to Test::Mojo.
- Added test method to Test::Mojo.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Mojolicious-8.36/META.json
new/Mojolicious-8.37/META.json
--- old/Mojolicious-8.36/META.json 2020-04-02 11:04:47.000000000 +0200
+++ new/Mojolicious-8.37/META.json 2020-04-19 21:46:49.000000000 +0200
@@ -62,6 +62,6 @@
},
"x_IRC" : "irc://irc.freenode.net/#mojo"
},
- "version" : "8.36",
+ "version" : "8.37",
"x_serialization_backend" : "JSON::PP version 4.04"
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Mojolicious-8.36/META.yml
new/Mojolicious-8.37/META.yml
--- old/Mojolicious-8.36/META.yml 2020-04-02 11:04:47.000000000 +0200
+++ new/Mojolicious-8.37/META.yml 2020-04-19 21:46:49.000000000 +0200
@@ -34,5 +34,5 @@
homepage: https://mojolicious.org
license: http://www.opensource.org/licenses/artistic-license-2.0
repository: https://github.com/mojolicious/mojo.git
-version: '8.36'
+version: '8.37'
x_serialization_backend: 'CPAN::Meta::YAML version 0.018'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Mojolicious-8.36/lib/Mojo/IOLoop/Stream.pm
new/Mojolicious-8.37/lib/Mojo/IOLoop/Stream.pm
--- old/Mojolicious-8.36/lib/Mojo/IOLoop/Stream.pm 2020-03-30
11:31:17.000000000 +0200
+++ new/Mojolicious-8.37/lib/Mojo/IOLoop/Stream.pm 2020-04-19
15:29:46.000000000 +0200
@@ -72,16 +72,24 @@
}
sub timeout {
- my $self = shift;
+ my ($self, $timeout) = @_;
- return $self->{timeout} unless @_;
+ return $self->{timeout} unless defined $timeout;
+ $self->{timeout} = $timeout;
my $reactor = $self->reactor;
- $reactor->remove(delete $self->{timer}) if $self->{timer};
- return $self unless my $timeout = $self->{timeout} = shift;
- weaken $self;
- $self->{timer} = $reactor->timer(
- $timeout => sub { delete $self->{timer}; $self->emit('timeout')->close });
+ if ($self->{timer}) {
+ if (!$self->{timeout}) { $reactor->remove(delete $self->{timer}) }
+ else { $reactor->again($self->{timer}, $self->{timeout})
}
+ }
+ else {
+ weaken $self;
+ $self->{timer} = $reactor->timer(
+ $timeout => sub {
+ $self and delete($self->{timer}) and $self->emit('timeout')->close;
+ }
+ );
+ }
return $self;
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Mojolicious-8.36/lib/Mojo/IOLoop.pm
new/Mojolicious-8.37/lib/Mojo/IOLoop.pm
--- old/Mojolicious-8.36/lib/Mojo/IOLoop.pm 2020-03-31 22:30:04.000000000
+0200
+++ new/Mojolicious-8.37/lib/Mojo/IOLoop.pm 2020-04-19 16:20:16.000000000
+0200
@@ -286,10 +286,11 @@
select the best possible L<EV> backend, which usually defaults to the not very
scalable C<select>.
- LIBEV_FLAGS=1 # select
- LIBEV_FLAGS=2 # poll
- LIBEV_FLAGS=4 # epoll (Linux)
- LIBEV_FLAGS=8 # kqueue (*BSD, OS X)
+ LIBEV_FLAGS=1 # select
+ LIBEV_FLAGS=2 # poll
+ LIBEV_FLAGS=4 # epoll (Linux)
+ LIBEV_FLAGS=8 # kqueue (*BSD, OS X)
+ LIBEV_FLAGS=64 # Linux AIO
The event loop will be resilient to time jumps if a monotonic clock is
available through L<Time::HiRes>. A TLS certificate and key are also built
@@ -298,7 +299,7 @@
loaded.
For better scalability (epoll, kqueue) and to provide non-blocking name
-resolution, SOCKS5 as well as TLS support, the optional modules L<EV> (4.0+),
+resolution, SOCKS5 as well as TLS support, the optional modules L<EV> (4.32+),
L<Net::DNS::Native> (0.15+), L<IO::Socket::Socks> (0.64+) and
L<IO::Socket::SSL> (2.009+) will be used automatically if possible. Individual
features can also be disabled with the C<MOJO_NO_NNR>, C<MOJO_NO_SOCKS> and
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Mojolicious-8.36/lib/Mojo/Message/Response.pm
new/Mojolicious-8.37/lib/Mojo/Message/Response.pm
--- old/Mojolicious-8.36/lib/Mojo/Message/Response.pm 2020-03-30
11:31:10.000000000 +0200
+++ new/Mojolicious-8.37/lib/Mojo/Message/Response.pm 2020-04-02
22:47:14.000000000 +0200
@@ -54,7 +54,7 @@
422 => 'Unprocessable Entity', # RFC 2518 (WebDAV)
423 => 'Locked', # RFC 2518 (WebDAV)
424 => 'Failed Dependency', # RFC 2518 (WebDAV)
- 425 => 'Unordered Collection', # RFC 3648 (WebDAV)
+ 425 => 'Too Early', # RFC 8470
426 => 'Upgrade Required', # RFC 2817
428 => 'Precondition Required', # RFC 6585
429 => 'Too Many Requests', # RFC 6585
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Mojolicious-8.36/lib/Mojo/Reactor/EV.pm
new/Mojolicious-8.37/lib/Mojo/Reactor/EV.pm
--- old/Mojolicious-8.36/lib/Mojo/Reactor/EV.pm 2020-03-30 11:31:19.000000000
+0200
+++ new/Mojolicious-8.37/lib/Mojo/Reactor/EV.pm 2020-04-19 16:04:33.000000000
+0200
@@ -2,15 +2,17 @@
use Mojo::Base 'Mojo::Reactor::Poll';
use Carp qw(croak);
-use EV 4.0;
+use EV 4.32;
my $EV;
sub DESTROY { undef $EV }
sub again {
- croak 'Timer not active' unless my $timer = shift->{timers}{shift()};
- $timer->{watcher}->again;
+ my ($self, $id, $after) = @_;
+ croak 'Timer not active' unless my $timer = $self->{timers}{$id};
+ my $w = $timer->{watcher};
+ defined $after ? $w->set($after, $w->repeat ? $after : 0) : $w->again;
}
# We have to fall back to Mojo::Reactor::Poll, since EV is unique
@@ -117,7 +119,7 @@
=head1 DESCRIPTION
-L<Mojo::Reactor::EV> is a low-level event reactor based on L<EV> (4.0+).
+L<Mojo::Reactor::EV> is a low-level event reactor based on L<EV> (4.32+).
=head1 EVENTS
@@ -131,8 +133,10 @@
=head2 again
$reactor->again($id);
+ $reactor->again($id, 0.5);
-Restart timer. Note that this method requires an active timer.
+Restart timer and optionally change the invocation time. Note that this method
+requires an active timer.
=head2 new
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Mojolicious-8.36/lib/Mojo/Reactor/Poll.pm
new/Mojolicious-8.37/lib/Mojo/Reactor/Poll.pm
--- old/Mojolicious-8.36/lib/Mojo/Reactor/Poll.pm 2020-03-30
11:31:19.000000000 +0200
+++ new/Mojolicious-8.37/lib/Mojo/Reactor/Poll.pm 2020-04-19
15:29:46.000000000 +0200
@@ -8,8 +8,10 @@
use Time::HiRes qw(usleep);
sub again {
- croak 'Timer not active' unless my $timer = shift->{timers}{shift()};
- $timer->{time} = steady_time + $timer->{after};
+ my ($self, $id, $after) = @_;
+ croak 'Timer not active' unless my $timer = $self->{timers}{$id};
+ $timer->{after} = $after if defined $after;
+ $timer->{time} = steady_time + $timer->{after};
}
sub io {
@@ -73,7 +75,7 @@
next unless $t->{time} <= $now;
# Recurring timer
- if (exists $t->{recurring}) { $t->{time} = $now + $t->{recurring} }
+ if ($t->{recurring}) { $t->{time} = $now + $t->{after} }
# Normal timer
else { $self->remove($id) }
@@ -133,9 +135,12 @@
my ($self, $recurring, $after, $cb) = @_;
my $id = $self->_id;
- my $timer = $self->{timers}{$id}
- = {cb => $cb, after => $after, time => steady_time + $after};
- $timer->{recurring} = $after if $recurring;
+ my $timer = $self->{timers}{$id} = {
+ cb => $cb,
+ after => $after,
+ recurring => $recurring,
+ time => steady_time + $after
+ };
return $id;
}
@@ -201,8 +206,10 @@
=head2 again
$reactor->again($id);
+ $reactor->again($id, 0.5);
-Restart timer. Note that this method requires an active timer.
+Restart timer and optionally change the invocation time. Note that this method
+requires an active timer.
=head2 io
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Mojolicious-8.36/lib/Mojo/Reactor.pm
new/Mojolicious-8.37/lib/Mojo/Reactor.pm
--- old/Mojolicious-8.36/lib/Mojo/Reactor.pm 2020-03-30 11:31:08.000000000
+0200
+++ new/Mojolicious-8.37/lib/Mojo/Reactor.pm 2020-04-19 15:29:46.000000000
+0200
@@ -87,9 +87,10 @@
=head2 again
$reactor->again($id);
+ $reactor->again($id, 0.5);
-Restart timer. Meant to be overloaded in a subclass. Note that this method
-requires an active timer.
+Restart timer and optionally change the invocation time. Meant to be overloaded
+in a subclass. Note that this method requires an active timer.
=head2 detect
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Mojolicious-8.36/lib/Mojo/Server/Daemon.pm
new/Mojolicious-8.37/lib/Mojo/Server/Daemon.pm
--- old/Mojolicious-8.36/lib/Mojo/Server/Daemon.pm 2020-03-30
11:31:12.000000000 +0200
+++ new/Mojolicious-8.37/lib/Mojo/Server/Daemon.pm 2020-04-19
16:28:05.000000000 +0200
@@ -13,8 +13,9 @@
has acceptors => sub { [] };
has [qw(backlog max_clients silent)];
-has inactivity_timeout => sub { $ENV{MOJO_INACTIVITY_TIMEOUT} // 15 };
+has inactivity_timeout => sub { $ENV{MOJO_INACTIVITY_TIMEOUT} // 30 };
has ioloop => sub { Mojo::IOLoop->singleton };
+has keep_alive_timeout => sub { $ENV{MOJO_KEEP_ALIVE_TIMEOUT} // 5 };
has listen => sub { [split ',', $ENV{MOJO_LISTEN} || 'http://*:3000'] };
has max_requests => 100;
@@ -78,7 +79,8 @@
my $tx = $self->build_tx->connection($id);
$tx->res->headers->server('Mojolicious (Perl)');
- my $handle = $self->ioloop->stream($id)->handle;
+ my $handle
+ = $self->ioloop->stream($id)->timeout($self->inactivity_timeout)->handle;
unless ($handle->isa('IO::Socket::UNIX')) {
$tx->local_address($handle->sockhost)->local_port($handle->sockport);
$tx->remote_address($handle->peerhost)->remote_port($handle->peerport);
@@ -155,7 +157,8 @@
return $self->_remove($id) if $tx->error || !$tx->keep_alive;
# Build new transaction for leftovers
- return unless length(my $leftovers = $tx->req->content->leftovers);
+ return $self->ioloop->stream($id)->timeout($self->keep_alive_timeout)
+ unless length(my $leftovers = $tx->req->content->leftovers);
$tx = $c->{tx} = $self->_build_tx($id, $c);
$tx->server_read($leftovers);
}
@@ -279,7 +282,7 @@
and multiple event loop support.
For better scalability (epoll, kqueue) and to provide non-blocking name
-resolution, SOCKS5 as well as TLS support, the optional modules L<EV> (4.0+),
+resolution, SOCKS5 as well as TLS support, the optional modules L<EV> (4.32+),
L<Net::DNS::Native> (0.15+), L<IO::Socket::Socks> (0.64+) and
L<IO::Socket::SSL> (2.009+) will be used automatically if possible. Individual
features can also be disabled with the C<MOJO_NO_NNR>, C<MOJO_NO_SOCKS> and
@@ -327,10 +330,10 @@
my $timeout = $daemon->inactivity_timeout;
$daemon = $daemon->inactivity_timeout(5);
-Maximum amount of time in seconds a connection can be inactive before getting
-closed, defaults to the value of the C<MOJO_INACTIVITY_TIMEOUT> environment
-variable or C<15>. Setting the value to C<0> will allow connections to be
-inactive indefinitely.
+Maximum amount of time in seconds a connection with an active request can be
+inactive before getting closed, defaults to the value of the
+C<MOJO_INACTIVITY_TIMEOUT> environment variable or C<30>. Setting the value to
+C<0> will allow connections to be inactive indefinitely.
=head2 ioloop
@@ -340,6 +343,16 @@
Event loop object to use for I/O operations, defaults to the global
L<Mojo::IOLoop> singleton.
+=head2 keep_alive_timeout
+
+ my $timeout = $daemon->keep_alive_timeout;
+ $daemon = $daemon->keep_alive_timeout(10);
+
+Maximum amount of time in seconds a connection without an active request can be
+inactive before getting closed, defaults to the value of the
+C<MOJO_KEEP_ALIVE_TIMEOUT> environment variable or C<5>. Setting the value to
+C<0> will allow connections to be inactive indefinitely.
+
=head2 listen
my $listen = $daemon->listen;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Mojolicious-8.36/lib/Mojo/Server/Hypnotoad.pm
new/Mojolicious-8.37/lib/Mojo/Server/Hypnotoad.pm
--- old/Mojolicious-8.36/lib/Mojo/Server/Hypnotoad.pm 2020-03-30
11:31:11.000000000 +0200
+++ new/Mojolicious-8.37/lib/Mojo/Server/Hypnotoad.pm 2020-04-19
16:04:18.000000000 +0200
@@ -26,7 +26,8 @@
$prefork->max_requests($c->{requests}) if $c->{requests};
defined $c->{$_} and $prefork->$_($c->{$_})
for qw(accepts backlog graceful_timeout heartbeat_interval),
- qw(heartbeat_timeout inactivity_timeout listen pid_file spare workers);
+ qw(heartbeat_timeout inactivity_timeout keep_alive_timeout listen
pid_file),
+ qw(spare workers);
}
sub run {
@@ -182,7 +183,7 @@
file with it, and send a L</"USR2"> signal to the already running server.
For better scalability (epoll, kqueue) and to provide non-blocking name
-resolution, SOCKS5 as well as TLS support, the optional modules L<EV> (4.0+),
+resolution, SOCKS5 as well as TLS support, the optional modules L<EV> (4.32+),
L<Net::DNS::Native> (0.15+), L<IO::Socket::Socks> (0.64+) and
L<IO::Socket::SSL> (2.009+) will be used automatically if possible. Individual
features can also be disabled with the C<MOJO_NO_NNR>, C<MOJO_NO_SOCKS> and
@@ -304,9 +305,19 @@
inactivity_timeout => 10
-Maximum amount of time in seconds a connection can be inactive before getting
-closed, defaults to the value of L<Mojo::Server::Daemon/"inactivity_timeout">.
-Setting the value to C<0> will allow connections to be inactive indefinitely.
+Maximum amount of time in seconds a connection with an active request can be
+inactive before getting closed, defaults to the value of
+L<Mojo::Server::Daemon/"inactivity_timeout">. Setting the value to C<0> will
+allow connections to be inactive indefinitely.
+
+=head2 keep_alive_timeout
+
+ keep_alive_timeout => 10
+
+Maximum amount of time in seconds a connection without an active request can be
+inactive before getting closed, defaults to the value of
+L<Mojo::Server::Daemon/"keep_alive_timeout">. Setting the value to C<0> will
+allow connections to be inactive indefinitely.
=head2 listen
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Mojolicious-8.36/lib/Mojo/Server/Morbo.pm
new/Mojolicious-8.37/lib/Mojo/Server/Morbo.pm
--- old/Mojolicious-8.36/lib/Mojo/Server/Morbo.pm 2020-03-30
11:31:11.000000000 +0200
+++ new/Mojolicious-8.37/lib/Mojo/Server/Morbo.pm 2020-04-19
16:04:25.000000000 +0200
@@ -100,7 +100,7 @@
Server available at http://127.0.0.1:3000
For better scalability (epoll, kqueue) and to provide non-blocking name
-resolution, SOCKS5 as well as TLS support, the optional modules L<EV> (4.0+),
+resolution, SOCKS5 as well as TLS support, the optional modules L<EV> (4.32+),
L<Net::DNS::Native> (0.15+), L<IO::Socket::Socks> (0.64+) and
L<IO::Socket::SSL> (2.009+) will be used automatically if possible. Individual
features can also be disabled with the C<MOJO_NO_NNR>, C<MOJO_NO_SOCKS> and
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Mojolicious-8.36/lib/Mojo/Server/Prefork.pm
new/Mojolicious-8.37/lib/Mojo/Server/Prefork.pm
--- old/Mojolicious-8.36/lib/Mojo/Server/Prefork.pm 2020-03-30
15:48:28.000000000 +0200
+++ new/Mojolicious-8.37/lib/Mojo/Server/Prefork.pm 2020-04-19
16:30:22.000000000 +0200
@@ -11,7 +11,7 @@
has accepts => 10000;
has cleanup => 1;
has graceful_timeout => 120;
-has heartbeat_timeout => 30;
+has heartbeat_timeout => 50;
has heartbeat_interval => 5;
has pid_file => sub { path(tmpdir, 'prefork.pid')->to_string };
has spare => 2;
@@ -235,7 +235,7 @@
handlers in your applications.
For better scalability (epoll, kqueue) and to provide non-blocking name
-resolution, SOCKS5 as well as TLS support, the optional modules L<EV> (4.0+),
+resolution, SOCKS5 as well as TLS support, the optional modules L<EV> (4.32+),
L<Net::DNS::Native> (0.15+), L<IO::Socket::Socks> (0.64+) and
L<IO::Socket::SSL> (1.84+) will be used automatically if possible. Individual
features can also be disabled with the C<MOJO_NO_NNR>, C<MOJO_NO_SOCKS> and
@@ -397,7 +397,7 @@
$prefork = $prefork->heartbeat_timeout(2);
Maximum amount of time in seconds before a worker without a heartbeat will be
-stopped gracefully, defaults to C<30>. Note that this value should usually be a
+stopped gracefully, defaults to C<50>. Note that this value should usually be a
little larger than the maximum amount of time you expect any one operation to
block the event loop.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Mojolicious-8.36/lib/Mojo/UserAgent.pm
new/Mojolicious-8.37/lib/Mojo/UserAgent.pm
--- old/Mojolicious-8.36/lib/Mojo/UserAgent.pm 2020-03-30 11:31:08.000000000
+0200
+++ new/Mojolicious-8.37/lib/Mojo/UserAgent.pm 2020-04-19 16:28:48.000000000
+0200
@@ -18,7 +18,7 @@
has cert => sub { $ENV{MOJO_CERT_FILE} };
has connect_timeout => sub { $ENV{MOJO_CONNECT_TIMEOUT} || 10 };
has cookie_jar => sub { Mojo::UserAgent::CookieJar->new };
-has inactivity_timeout => sub { $ENV{MOJO_INACTIVITY_TIMEOUT} // 20 };
+has inactivity_timeout => sub { $ENV{MOJO_INACTIVITY_TIMEOUT} // 40 };
has insecure => sub { $ENV{MOJO_INSECURE} };
has [qw(local_address max_response_size)];
has ioloop => sub { Mojo::IOLoop->new };
@@ -449,7 +449,7 @@
safely.
For better scalability (epoll, kqueue) and to provide non-blocking name
-resolution, SOCKS5 as well as TLS support, the optional modules L<EV> (4.0+),
+resolution, SOCKS5 as well as TLS support, the optional modules L<EV> (4.32+),
L<Net::DNS::Native> (0.15+), L<IO::Socket::Socks> (0.64+) and
L<IO::Socket::SSL> (2.009+) will be used automatically if possible. Individual
features can also be disabled with the C<MOJO_NO_NNR>, C<MOJO_NO_SOCKS> and
@@ -563,7 +563,7 @@
Maximum amount of time in seconds a connection can be inactive before getting
closed, defaults to the value of the C<MOJO_INACTIVITY_TIMEOUT> environment
-variable or C<20>. Setting the value to C<0> will allow connections to be
+variable or C<40>. Setting the value to C<0> will allow connections to be
inactive indefinitely.
=head2 insecure
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Mojolicious-8.36/lib/Mojolicious/Command/daemon.pm
new/Mojolicious-8.37/lib/Mojolicious/Command/daemon.pm
--- old/Mojolicious-8.36/lib/Mojolicious/Command/daemon.pm 2020-03-31
22:33:26.000000000 +0200
+++ new/Mojolicious-8.37/lib/Mojolicious/Command/daemon.pm 2020-04-19
16:31:12.000000000 +0200
@@ -15,6 +15,7 @@
'b|backlog=i' => sub { $daemon->backlog($_[1]) },
'c|clients=i' => sub { $daemon->max_clients($_[1]) },
'i|inactivity-timeout=i' => sub { $daemon->inactivity_timeout($_[1]) },
+ 'k|keep-alive-timeout=i' => sub { $daemon->keep_alive_timeout($_[1]) },
'l|listen=s' => \my @listen,
'p|proxy' => sub { $daemon->reverse_proxy(1) },
'r|requests=i' => sub { $daemon->max_requests($_[1]) };
@@ -51,7 +52,9 @@
application, defaults to the value of
MOJO_HOME or auto-detection
-i, --inactivity-timeout <seconds> Inactivity timeout, defaults to the
- value of MOJO_INACTIVITY_TIMEOUT or 15
+ value of MOJO_INACTIVITY_TIMEOUT or 30
+ -k, --keep-alive-timeout <seconds> Keep-alive timeout, defaults to the
+ value of MOJO_KEEP_ALIVE_TIMEOUT or 5
-l, --listen <location> One or more locations you want to
listen on, defaults to the value of
MOJO_LISTEN or "http://*:3000"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Mojolicious-8.36/lib/Mojolicious/Command/get.pm
new/Mojolicious-8.37/lib/Mojolicious/Command/get.pm
--- old/Mojolicious-8.36/lib/Mojolicious/Command/get.pm 2020-03-31
22:33:47.000000000 +0200
+++ new/Mojolicious-8.37/lib/Mojolicious/Command/get.pm 2020-04-19
16:43:00.000000000 +0200
@@ -171,7 +171,7 @@
application, defaults to the value of
MOJO_HOME or auto-detection
-i, --inactivity-timeout <seconds> Inactivity timeout, defaults to the
- value of MOJO_INACTIVITY_TIMEOUT or 20
+ value of MOJO_INACTIVITY_TIMEOUT or 40
-k, --insecure Do not require a valid TLS certificate
to access HTTPS sites
-M, --method <method> HTTP method to use, defaults to "GET"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Mojolicious-8.36/lib/Mojolicious/Command/prefork.pm
new/Mojolicious-8.37/lib/Mojolicious/Command/prefork.pm
--- old/Mojolicious-8.36/lib/Mojolicious/Command/prefork.pm 2020-03-31
22:34:07.000000000 +0200
+++ new/Mojolicious-8.37/lib/Mojolicious/Command/prefork.pm 2020-04-19
16:31:47.000000000 +0200
@@ -20,6 +20,7 @@
'I|heartbeat-interval=i' => sub { $prefork->heartbeat_interval($_[1]) },
'H|heartbeat-timeout=i' => sub { $prefork->heartbeat_timeout($_[1]) },
'i|inactivity-timeout=i' => sub { $prefork->inactivity_timeout($_[1]) },
+ 'k|keep-alive-timeout=i' => sub { $prefork->keep_alive_timeout($_[1]) },
'l|listen=s' => \my @listen,
'P|pid-file=s' => sub { $prefork->pid_file($_[1]) },
'p|proxy' => sub { $prefork->reverse_proxy(1) },
@@ -58,13 +59,15 @@
connections, defaults to 1000
-G, --graceful-timeout <seconds> Graceful timeout, defaults to 120.
-I, --heartbeat-interval <seconds> Heartbeat interval, defaults to 5
- -H, --heartbeat-timeout <seconds> Heartbeat timeout, defaults to 30
+ -H, --heartbeat-timeout <seconds> Heartbeat timeout, defaults to 50
-h, --help Show this summary of available options
--home <path> Path to home directory of your
application, defaults to the value of
MOJO_HOME or auto-detection
-i, --inactivity-timeout <seconds> Inactivity timeout, defaults to the
- value of MOJO_INACTIVITY_TIMEOUT or 15
+ value of MOJO_INACTIVITY_TIMEOUT or 30
+ -k, --keep-alive-timeout <seconds> Keep-alive timeout, defaults to the
+ value of MOJO_KEEP_ALIVE_TIMEOUT or 5
-l, --listen <location> One or more locations you want to
listen on, defaults to the value of
MOJO_LISTEN or "http://*:3000"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Mojolicious-8.36/lib/Mojolicious/Command/version.pm
new/Mojolicious-8.37/lib/Mojolicious/Command/version.pm
--- old/Mojolicious-8.36/lib/Mojolicious/Command/version.pm 2020-03-31
22:34:39.000000000 +0200
+++ new/Mojolicious-8.37/lib/Mojolicious/Command/version.pm 2020-04-19
16:04:53.000000000 +0200
@@ -28,7 +28,7 @@
OPTIONAL
Cpanel::JSON::XS 4.09+ ($json)
- EV 4.0+ ($ev)
+ EV 4.32+ ($ev)
IO::Socket::Socks 0.64+ ($socks)
IO::Socket::SSL 2.009+ ($tls)
Net::DNS::Native 0.15+ ($nnr)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Mojolicious-8.36/lib/Mojolicious/Controller.pm
new/Mojolicious-8.37/lib/Mojolicious/Controller.pm
--- old/Mojolicious-8.36/lib/Mojolicious/Controller.pm 2020-03-30
11:31:21.000000000 +0200
+++ new/Mojolicious-8.37/lib/Mojolicious/Controller.pm 2020-04-19
16:38:11.000000000 +0200
@@ -704,7 +704,7 @@
For mostly idle WebSockets you might also want to increase the inactivity
timeout with L<Mojolicious::Plugin::DefaultHelpers/"inactivity_timeout">, which
-usually defaults to C<15> seconds.
+usually defaults to C<30> seconds.
# Increase inactivity timeout for connection to 300 seconds
$c->inactivity_timeout(300);
@@ -860,7 +860,7 @@
For Comet (long polling) you might also want to increase the inactivity timeout
with L<Mojolicious::Plugin::DefaultHelpers/"inactivity_timeout">, which usually
-defaults to C<15> seconds.
+defaults to C<30> seconds.
# Increase inactivity timeout for connection to 300 seconds
$c->inactivity_timeout(300);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Mojolicious-8.36/lib/Mojolicious/Guides/FAQ.pod
new/Mojolicious-8.37/lib/Mojolicious/Guides/FAQ.pod
--- old/Mojolicious-8.36/lib/Mojolicious/Guides/FAQ.pod 2019-11-21
17:49:24.000000000 +0100
+++ new/Mojolicious-8.37/lib/Mojolicious/Guides/FAQ.pod 2020-04-19
16:38:56.000000000 +0200
@@ -208,8 +208,8 @@
To protect your applications from denial-of-service attacks, all connections
have an inactivity timeout which limits how long a connection may be inactive
-before being closed automatically. It defaults to C<20> seconds for the user
-agent and C<15> seconds for all built-in web servers, and can be changed with
+before being closed automatically. It defaults to C<40> seconds for the user
+agent and C<30> seconds for all built-in web servers, and can be changed with
the attributes L<Mojo::UserAgent/"inactivity_timeout"> and
L<Mojo::Server::Daemon/"inactivity_timeout"> or the C<MOJO_INACTIVITY_TIMEOUT>
environment variable. In L<Mojolicious> applications you can also use the
helper
@@ -234,14 +234,14 @@
});
});
-=head2 What does "Worker 31842 has no heartbeat (30 seconds), restarting" mean?
+=head2 What does "Worker 31842 has no heartbeat (50 seconds), restarting" mean?
As long as they are accepting new connections, worker processes of all built-in
pre-forking web servers send heartbeat messages to the manager process at
regular intervals, to signal that they are still responsive. A blocking
operation such as an infinite loop in your application can prevent this, and
will force the affected worker to be restarted after a timeout. This timeout
-defaults to C<30> seconds and can be extended with the attribute
+defaults to C<50> seconds and can be extended with the attribute
L<Mojo::Server::Prefork/"heartbeat_timeout"> if your application requires it.
=head2 What does "Transaction already destroyed" mean?
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Mojolicious-8.36/lib/Mojolicious.pm
new/Mojolicious-8.37/lib/Mojolicious.pm
--- old/Mojolicious-8.36/lib/Mojolicious.pm 2020-03-30 11:33:40.000000000
+0200
+++ new/Mojolicious-8.37/lib/Mojolicious.pm 2020-04-02 11:05:32.000000000
+0200
@@ -59,7 +59,7 @@
has validator => sub { Mojolicious::Validator->new };
our $CODENAME = 'Supervillain';
-our $VERSION = '8.36';
+our $VERSION = '8.37';
sub BUILD_DYNAMIC {
my ($class, $method, $dyn_methods) = @_;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Mojolicious-8.36/t/mojo/daemon.t
new/Mojolicious-8.37/t/mojo/daemon.t
--- old/Mojolicious-8.36/t/mojo/daemon.t 2020-03-30 11:31:38.000000000
+0200
+++ new/Mojolicious-8.37/t/mojo/daemon.t 2020-04-19 16:34:38.000000000
+0200
@@ -33,13 +33,18 @@
is $tx->res->code, 200, 'right status';
is $tx->res->body, 'Hello TestApp!', 'right content';
-# Timeout
+# Timeouts
{
- is(Mojo::Server::Daemon->new->inactivity_timeout, 15, 'right value');
+ is(Mojo::Server::Daemon->new->inactivity_timeout, 30, 'right value');
local $ENV{MOJO_INACTIVITY_TIMEOUT} = 25;
is(Mojo::Server::Daemon->new->inactivity_timeout, 25, 'right value');
$ENV{MOJO_INACTIVITY_TIMEOUT} = 0;
is(Mojo::Server::Daemon->new->inactivity_timeout, 0, 'right value');
+ is(Mojo::Server::Daemon->new->keep_alive_timeout, 5, 'right value');
+ local $ENV{MOJO_KEEP_ALIVE_TIMEOUT} = 25;
+ is(Mojo::Server::Daemon->new->keep_alive_timeout, 25, 'right value');
+ $ENV{MOJO_KEEP_ALIVE_TIMEOUT} = 0;
+ is(Mojo::Server::Daemon->new->keep_alive_timeout, 0, 'right value');
}
# Listen
@@ -150,6 +155,15 @@
}
);
+$app->routes->any(
+ '/timeout' => sub {
+ my $c = shift;
+ my $id = $c->tx->connection;
+ $c->res->headers->header('X-Connection-ID' => $id);
+ $c->render(text => Mojo::IOLoop->stream($id)->timeout);
+ }
+);
+
$app->routes->any('/*whatever' => {text => 'Whatever!'});
# Normal request
@@ -235,6 +249,14 @@
ok $remote_address, 'has remote address';
ok $remote_port > 0, 'has remote port';
+# Timeout
+$tx = $ua->get('/timeout');
+ok $tx->keep_alive, 'will be kept alive';
+is $tx->res->code, 200, 'right status';
+is $tx->res->body, 30, 'inactivity timeout was used for the request';
+is(Mojo::IOLoop->stream($tx->res->headers->header('X-Connection-ID'))->timeout,
+ 5, 'keep-alive timeout was assigned after the request');
+
# Pipelined
$daemon
= Mojo::Server::Daemon->new({listen => ['http://127.0.0.1'], silent => 1});
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Mojolicious-8.36/t/mojo/hypnotoad.t
new/Mojolicious-8.37/t/mojo/hypnotoad.t
--- old/Mojolicious-8.36/t/mojo/hypnotoad.t 2020-03-30 11:31:53.000000000
+0200
+++ new/Mojolicious-8.37/t/mojo/hypnotoad.t 2020-04-19 15:29:46.000000000
+0200
@@ -24,6 +24,7 @@
heartbeat_interval => 7,
heartbeat_timeout => 9,
inactivity_timeout => 5,
+ keep_alive_timeout => 3,
listen => ['http://*:8081'],
pid_file => '/foo/bar.pid',
proxy => 1,
@@ -42,6 +43,7 @@
is $hypnotoad->prefork->heartbeat_interval, 7, 'right value';
is $hypnotoad->prefork->heartbeat_timeout, 9, 'right value';
is $hypnotoad->prefork->inactivity_timeout, 5, 'right value';
+ is $hypnotoad->prefork->keep_alive_timeout, 3, 'right value';
is_deeply $hypnotoad->prefork->listen, ['http://*:8081'], 'right value';
is $hypnotoad->prefork->max_clients, 1, 'right value';
is $hypnotoad->prefork->max_requests, 3, 'right value';
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Mojolicious-8.36/t/mojo/reactor_ev.t
new/Mojolicious-8.37/t/mojo/reactor_ev.t
--- old/Mojolicious-8.36/t/mojo/reactor_ev.t 2020-03-30 11:31:40.000000000
+0200
+++ new/Mojolicious-8.37/t/mojo/reactor_ev.t 2020-04-19 16:05:15.000000000
+0200
@@ -4,10 +4,11 @@
plan skip_all => 'set TEST_EV to enable this test (developer only!)'
unless $ENV{TEST_EV} || $ENV{TEST_ALL};
-plan skip_all => 'EV 4.0+ required for this test!'
- unless eval { require EV; EV->VERSION('4.0'); 1 };
+plan skip_all => 'EV 4.32+ required for this test!'
+ unless eval { require EV; EV->VERSION('4.32'); 1 };
use IO::Socket::INET;
+use Mojo::Util qw(steady_time);
# Instantiation
use_ok 'Mojo::Reactor::EV';
@@ -192,6 +193,7 @@
$reactor2->start;
ok !$timer, 'timer was not triggered';
ok $timer2, 'timer was triggered';
+$reactor->reset;
# Restart timer
my ($single, $pair, $one, $two, $last);
@@ -215,6 +217,28 @@
ok $single, 'single timer was triggered';
ok $last, 'timers were triggered in the right order';
+# Reset timer
+my $before = steady_time;
+my ($after, $again);
+$one = $reactor->timer(300 => sub { $after = steady_time });
+$two = $reactor->recurring(
+ 300 => sub {
+ my $reactor = shift;
+ $reactor->remove($two) if ++$again > 3;
+ }
+);
+$reactor->timer(
+ 0.025 => sub {
+ my $reactor = shift;
+ $reactor->again($one, 0.025);
+ $reactor->again($two, 0.025);
+ }
+);
+$reactor->start;
+ok $after, 'timer was triggered';
+ok(($after - $before) < 200, 'less than 200 seconds');
+is $again, 4, 'recurring timer triggered four times';
+
# Restart inactive timer
$id = $reactor->timer(0 => sub { });
ok $reactor->remove($id), 'removed';
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Mojolicious-8.36/t/mojo/reactor_poll.t
new/Mojolicious-8.37/t/mojo/reactor_poll.t
--- old/Mojolicious-8.36/t/mojo/reactor_poll.t 2020-03-30 11:31:48.000000000
+0200
+++ new/Mojolicious-8.37/t/mojo/reactor_poll.t 2020-04-19 15:29:46.000000000
+0200
@@ -5,6 +5,7 @@
use Test::More;
use IO::Socket::INET;
use Mojo::Reactor::Poll;
+use Mojo::Util qw(steady_time);
# Instantiation
my $reactor = Mojo::Reactor::Poll->new;
@@ -188,6 +189,7 @@
$reactor2->start;
ok !$timer, 'timer was not triggered';
ok $timer2, 'timer was triggered';
+$reactor->reset;
# Restart timer
my ($single, $pair, $one, $two, $last);
@@ -211,6 +213,28 @@
ok $single, 'single timer was triggered';
ok $last, 'timers were triggered in the right order';
+# Reset timer
+my $before = steady_time;
+my ($after, $again);
+$one = $reactor->timer(300 => sub { $after = steady_time });
+$two = $reactor->recurring(
+ 300 => sub {
+ my $reactor = shift;
+ $reactor->remove($two) if ++$again > 3;
+ }
+);
+$reactor->timer(
+ 0.025 => sub {
+ my $reactor = shift;
+ $reactor->again($one, 0.025);
+ $reactor->again($two, 0.025);
+ }
+);
+$reactor->start;
+ok $after, 'timer was triggered';
+ok(($after - $before) < 200, 'less than 200 seconds');
+is $again, 4, 'recurring timer triggered four times';
+
# Restart inactive timer
$id = $reactor->timer(0 => sub { });
ok $reactor->remove($id), 'removed';
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Mojolicious-8.36/t/mojo/response.t
new/Mojolicious-8.37/t/mojo/response.t
--- old/Mojolicious-8.36/t/mojo/response.t 2020-03-30 11:31:37.000000000
+0200
+++ new/Mojolicious-8.37/t/mojo/response.t 2020-04-02 22:48:34.000000000
+0200
@@ -64,7 +64,7 @@
is $res->code(422)->default_message, 'Unprocessable Entity', 'right message';
is $res->code(423)->default_message, 'Locked', 'right message';
is $res->code(424)->default_message, 'Failed Dependency', 'right message';
-is $res->code(425)->default_message, 'Unordered Collection', 'right message';
+is $res->code(425)->default_message, 'Too Early', 'right message';
is $res->code(426)->default_message, 'Upgrade Required', 'right message';
is $res->code(428)->default_message, 'Precondition Required', 'right message';
is $res->code(429)->default_message, 'Too Many Requests', 'right message';
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Mojolicious-8.36/t/mojo/subprocess_ev.t
new/Mojolicious-8.37/t/mojo/subprocess_ev.t
--- old/Mojolicious-8.36/t/mojo/subprocess_ev.t 2020-03-30 11:31:37.000000000
+0200
+++ new/Mojolicious-8.37/t/mojo/subprocess_ev.t 2020-04-19 16:05:27.000000000
+0200
@@ -6,8 +6,8 @@
unless $ENV{TEST_SUBPROCESS} || $ENV{TEST_ALL};
plan skip_all => 'set TEST_EV to enable this test (developer only!)'
unless $ENV{TEST_EV} || $ENV{TEST_ALL};
-plan skip_all => 'EV 4.0+ required for this test!'
- unless eval { require EV; EV->VERSION('4.0'); 1 };
+plan skip_all => 'EV 4.32+ required for this test!'
+ unless eval { require EV; EV->VERSION('4.32'); 1 };
use Mojo::IOLoop;
use Mojo::Promise;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Mojolicious-8.36/t/mojo/user_agent.t
new/Mojolicious-8.37/t/mojo/user_agent.t
--- old/Mojolicious-8.36/t/mojo/user_agent.t 2020-03-30 11:31:55.000000000
+0200
+++ new/Mojolicious-8.37/t/mojo/user_agent.t 2020-04-19 16:29:27.000000000
+0200
@@ -81,7 +81,7 @@
is(Mojo::UserAgent->new->connect_timeout, 10, 'right value');
local $ENV{MOJO_CONNECT_TIMEOUT} = 25;
is(Mojo::UserAgent->new->connect_timeout, 25, 'right value');
- is(Mojo::UserAgent->new->inactivity_timeout, 20, 'right value');
+ is(Mojo::UserAgent->new->inactivity_timeout, 40, 'right value');
local $ENV{MOJO_INACTIVITY_TIMEOUT} = 25;
is(Mojo::UserAgent->new->inactivity_timeout, 25, 'right value');
$ENV{MOJO_INACTIVITY_TIMEOUT} = 0;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Mojolicious-8.36/t/mojo/websocket.t
new/Mojolicious-8.37/t/mojo/websocket.t
--- old/Mojolicious-8.36/t/mojo/websocket.t 2020-03-30 11:31:39.000000000
+0200
+++ new/Mojolicious-8.37/t/mojo/websocket.t 2020-04-19 16:35:43.000000000
+0200
@@ -162,7 +162,7 @@
Mojo::IOLoop->start;
ok !$ws, 'not a WebSocket';
is $code, 200, 'right status';
-ok $body =~ /^(\d+)failed!$/ && $1 == 15, 'right content';
+ok $body =~ /^(\d+)failed!$/ && $1 == 30, 'right content';
# Server directly sends a message
$result = '';