Skip to content

Commit

Permalink
mention a few more features in user agent and web server descriptions
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Apr 15, 2013
1 parent b1dfa58 commit 3ac894c
Show file tree
Hide file tree
Showing 11 changed files with 44 additions and 41 deletions.
20 changes: 10 additions & 10 deletions Changes
@@ -1,5 +1,5 @@

3.96 2013-04-14
3.96 2013-04-16
- Improved default descriptions in Test::Mojo.
- Improved documentation.
- Improved tests.
Expand Down Expand Up @@ -322,7 +322,7 @@
3.59 2012-11-20
- Improved tests.
- Fixed memory leak in Mojo::Message::Request.
- Fixed keep alive bug in Mojo::Server::Daemon.
- Fixed keep-alive bug in Mojo::Server::Daemon.

3.58 2012-11-19
- Improved documentation.
Expand Down Expand Up @@ -881,7 +881,7 @@
- Added support for alternative MIME types to Mojolicious::Types.
- Added endpoint method to Mojo::UserAgent::Transactor.
- Improved tests.
- Fixed HTTPS proxy keep alive bug in Mojo::UserAgent.
- Fixed HTTPS proxy keep-alive bug in Mojo::UserAgent.

2.79 2012-04-10
- Improved makefile and plugin generators to always use the latest
Expand Down Expand Up @@ -1372,7 +1372,7 @@
Mojo::IOLoop::Stream::timeout.
- Added EXPERIMENTAL timeout event to Mojo::IOLoop::Stream.
- Added EXPERIMENTAL timeout attribute to Mojo::IOLoop::Stream.
- Changed default keep alive timeout of Mojo::UserAgent from 15 to 20
- Changed default keep-alive timeout of Mojo::UserAgent from 15 to 20
seconds.
- Improved documentation.
- Improved Unicode tests.
Expand All @@ -1381,7 +1381,7 @@
2.36 2011-12-05
- Changed default heartbeat timeout of Hypnotoad from 5 to 10 seconds.
- Improved documentation.
- Fixed default keep alive timeout of Hypnotoad.
- Fixed default keep-alive timeout of Hypnotoad.

2.35 2011-12-01
- Added EXPERIMENTAL etag method to Mojo::Headers.
Expand Down Expand Up @@ -1844,7 +1844,7 @@
- Improved documentation.

1.72 2011-08-05
- Changed default keep alive timeout in Mojo::Server::Daemon from 5 to 15
- Changed default keep-alive timeout in Mojo::Server::Daemon from 5 to 15
seconds.
- Improved documentation.
- Fixed small alternative placeholder value bug in routes.
Expand Down Expand Up @@ -2528,7 +2528,7 @@
- Improved RFC 3986 compliance of Mojo::Path. (janus)
- Improved Mojo::Server::PSGI to preload applications.
- Improved FastCGI detection for Dreamhost. (garu)
- Improved keep alive timeout handling in Mojo::Client.
- Improved keep-alive timeout handling in Mojo::Client.
- Improved documentation. (rhaen)
- Improved Mojo::ByteStream performance. (mons)
- Improved Mojo::Parameters performance. (kimoto)
Expand Down Expand Up @@ -2674,7 +2674,7 @@
- Improved routes by making the leading slash optional and storing route
names in the stash.
- Converted README to markdown. (memowe)
- Fixed connection keep alive with epoll.
- Fixed connection keep-alive with epoll.
- Fixed bridge bug in MojoX::Routes::Match.
(Oleg Zhelo, Dmitry Konstantinov)
- Fixed argument handling of Mojo::Template blocks. (afresh1)
Expand Down Expand Up @@ -3005,7 +3005,7 @@
- Fixed body callbacks to get automatic buffering.
- Fixed a case where Mojo::Server::Daemon and Mojo::Client were too
defensive and made them in turn 20 times faster.
- Fixed keep alive problem in Mojo::Transaction::Pipeline.
- Fixed keep-alive problem in Mojo::Transaction::Pipeline.
- Fixed and simplified Mojo::Parameters. (gbarr)
- Fixed xml_escape to use character semantics. (vti)
- Fixed utf8 handling of routes captures. (vti)
Expand Down Expand Up @@ -3433,7 +3433,7 @@
- Added prepare_parser and prepare_builder callbacks to Mojo::Message.
- Added done and is_done to Mojo::Stateful.
- Fixed many win32 related bugs.
- Fixed keep alive related bugs in daemon and client. (Pedro Melo)
- Fixed keep-alive related bugs in daemon and client. (Pedro Melo)
- Allow default in Mojo::Base to have false values. (Pedro Melo)
- Fixed chmod_rel_file in Mojo::Script. (Shu Cho).
- Mojo::Base attributes can't start with a digit. (Shu Cho).
Expand Down
3 changes: 2 additions & 1 deletion README.md
Expand Up @@ -23,7 +23,8 @@
recommended, and optional CPAN modules will be used to provide advanced
functionality if they are installed).
* Full stack HTTP and WebSocket client/server implementation with IPv6, TLS,
SNI, IDNA, Comet (long polling) and gzip compression support.
SNI, IDNA, Comet (long polling), keep-alive, connection pooling, timeouts
and gzip compression support.
* Built-in non-blocking I/O web server, supporting multiple event loops and
hot deployment, perfect for embedding.
* Automatic CGI and [PSGI](http://plackperl.org) detection.
Expand Down
8 changes: 4 additions & 4 deletions lib/Mojo/Server/Daemon.pm
Expand Up @@ -215,7 +215,7 @@ sub _read {
warn "-- Server <<< Client (@{[$tx->req->url->to_abs]})\n$chunk\n" if DEBUG;
$tx->server_read($chunk);

# Last keep alive request or corrupted connection
# Last keep-alive request or corrupted connection
$tx->res->headers->connection('close')
if (($c->{requests} || 0) >= $self->max_requests) || $tx->req->error;

Expand Down Expand Up @@ -292,8 +292,8 @@ Mojo::Server::Daemon - Non-blocking I/O HTTP and WebSocket server
=head1 DESCRIPTION
L<Mojo::Server::Daemon> is a full featured, highly portable non-blocking I/O
HTTP and WebSocket server, with C<IPv6>, C<TLS>, C<Comet> (long polling) and
multiple event loop support.
HTTP and WebSocket server, with C<IPv6>, C<TLS>, C<Comet> (long polling),
C<keep-alive>, connection pooling, timeouts and multiple event loop support.
Optional modules L<EV> (4.0+), L<IO::Socket::IP> (0.16+) and
L<IO::Socket::SSL> (1.75+) are supported transparently through
Expand Down Expand Up @@ -398,7 +398,7 @@ Maximum number of parallel client connections, defaults to C<1000>.
my $max = $daemon->max_requests;
$daemon = $daemon->max_requests(100);
Maximum number of keep alive requests per connection, defaults to C<25>.
Maximum number of keep-alive requests per connection, defaults to C<25>.
=head2 silent
Expand Down
9 changes: 5 additions & 4 deletions lib/Mojo/Server/Hypnotoad.pm
Expand Up @@ -162,9 +162,10 @@ Mojo::Server::Hypnotoad - ALL GLORY TO THE HYPNOTOAD!
L<Mojo::Server::Hypnotoad> is a full featured, UNIX optimized, preforking
non-blocking I/O HTTP and WebSocket server, built around the very well tested
and reliable L<Mojo::Server::Prefork>, with C<IPv6>, C<TLS>, C<Comet> (long
polling), multiple event loop and hot deployment support that just works. Note
that the server uses signals for process management, so you should avoid
modifying signal handlers in your applications.
polling), C<keep-alive>, connection pooling, timeouts, multiple event loop and
hot deployment support that just works. Note that the server uses signals for
process management, so you should avoid modifying signal handlers in your
applications.
To start applications with it you can use the L<hypnotoad> script.
Expand Down Expand Up @@ -322,7 +323,7 @@ be inactive indefinitely.
keep_alive_requests => 50
Number of keep alive requests per connection, defaults to C<25>.
Number of keep-alive requests per connection, defaults to C<25>.
=head2 listen
Expand Down
8 changes: 4 additions & 4 deletions lib/Mojo/Server/Morbo.pm
Expand Up @@ -115,10 +115,10 @@ Mojo::Server::Morbo - DOOOOOOOOOOOOOOOOOOM!
L<Mojo::Server::Morbo> is a full featured, self-restart capable non-blocking
I/O HTTP and WebSocket server, built around the very well tested and reliable
L<Mojo::Server::Daemon>, with C<IPv6>, C<TLS>, C<Comet> (long polling) and
multiple event loop support. Note that the server uses signals for process
management, so you should avoid modifying signal handlers in your
applications.
L<Mojo::Server::Daemon>, with C<IPv6>, C<TLS>, C<Comet> (long polling),
C<keep-alive>, connection pooling, timeouts and multiple event loop support.
Note that the server uses signals for process management, so you should avoid
modifying signal handlers in your applications.
To start applications with it you can use the L<morbo> script.
Expand Down
6 changes: 3 additions & 3 deletions lib/Mojo/Server/Prefork.pm
Expand Up @@ -257,9 +257,9 @@ Mojo::Server::Prefork - Preforking non-blocking I/O HTTP and WebSocket server
L<Mojo::Server::Prefork> is a full featured, UNIX optimized, preforking
non-blocking I/O HTTP and WebSocket server, built around the very well tested
and reliable L<Mojo::Server::Daemon>, with C<IPv6>, C<TLS>, C<Comet> (long
polling) and multiple event loop support. Note that the server uses signals
for process management, so you should avoid modifying signal handlers in your
applications.
polling), C<keep-alive>, connection pooling, timeouts and multiple event loop
support. Note that the server uses signals for process management, so you
should avoid modifying signal handlers in your applications.
Optional modules L<EV> (4.0+), L<IO::Socket::IP> (0.16+) and
L<IO::Socket::SSL> (1.75+) are supported transparently through
Expand Down
4 changes: 2 additions & 2 deletions lib/Mojo/Transaction/HTTP.pm
Expand Up @@ -30,10 +30,10 @@ sub keep_alive {
my $res_conn = lc($res->headers->connection // '');
return undef if $req_conn eq 'close' || $res_conn eq 'close';

# Keep alive
# Keep-alive
return 1 if $req_conn eq 'keep-alive' || $res_conn eq 'keep-alive';

# No keep alive for 1.0
# No keep-alive for 1.0
return !($req->version eq '1.0' || $res->version eq '1.0');
}

Expand Down
9 changes: 5 additions & 4 deletions lib/Mojo/UserAgent.pm
Expand Up @@ -180,7 +180,7 @@ sub _cleanup {
# Clean up active connections (by closing them)
$self->_handle($_ => 1) for keys %{$self->{connections} || {}};

# Clean up keep alive connections
# Clean up keep-alive connections
$loop->remove($_->[1]) for @{delete $self->{cache} || []};

# Stop server
Expand Down Expand Up @@ -590,8 +590,9 @@ Mojo::UserAgent - Non-blocking I/O HTTP and WebSocket user agent
=head1 DESCRIPTION
L<Mojo::UserAgent> is a full featured non-blocking I/O HTTP and WebSocket user
agent, with C<IPv6>, C<TLS>, C<SNI>, C<IDNA>, C<Comet> (long polling), C<gzip>
compression and multiple event loop support.
agent, with C<IPv6>, C<TLS>, C<SNI>, C<IDNA>, C<Comet> (long polling),
C<keep-alive>, connection pooling, timeouts, C<gzip> compression and multiple
event loop support.
Optional modules L<EV> (4.0+), L<IO::Socket::IP> (0.16+) and
L<IO::Socket::SSL> (1.75+) are supported transparently through
Expand Down Expand Up @@ -730,7 +731,7 @@ Local address to bind to.
my $max = $ua->max_connections;
$ua = $ua->max_connections(5);
Maximum number of keep alive connections that the user agent will retain
Maximum number of keep-alive connections that the user agent will retain
before it starts closing the oldest cached ones, defaults to C<5>.
=head2 max_redirects
Expand Down
6 changes: 3 additions & 3 deletions t/mojo/app.t
Expand Up @@ -103,22 +103,22 @@ ok $tx->keep_alive, 'will be kept alive';
is $tx->res->code, 200, 'right status';
is $tx->res->body, 'Whatever!', 'right content';

# Keep alive request
# Keep-alive request
$tx = $ua->get('/normal/');
ok $tx->keep_alive, 'will be kept alive';
ok $tx->kept_alive, 'was kept alive';
is $tx->res->code, 200, 'right status';
is $tx->res->body, 'Whatever!', 'right content';

# Non keep alive request
# Non keep-alive request
$tx = $ua->get('/close/' => {Connection => 'close'});
ok !$tx->keep_alive, 'will not be kept alive';
ok $tx->kept_alive, 'was kept alive';
is $tx->res->code, 200, 'right status';
is $tx->res->headers->connection, 'close', 'right "Connection" value';
is $tx->res->body, 'Whatever!', 'right content';

# Second non keep alive request
# Second non keep-alive request
$tx = $ua->get('/close/' => {Connection => 'close'});
ok !$tx->keep_alive, 'will not be kept alive';
ok !$tx->kept_alive, 'was not kept alive';
Expand Down
2 changes: 1 addition & 1 deletion t/mojo/hypnotoad.t
Expand Up @@ -128,7 +128,7 @@ ok $tx->kept_alive, 'connection was kept alive';
is $tx->res->code, 200, 'right status';
is $tx->res->body, 'Hello Hypnotoad!', 'right content';

# Remove keep alive connections
# Remove keep-alive connections
$ua = Mojo::UserAgent->new;

# Wait for hot deployment to finish
Expand Down
10 changes: 5 additions & 5 deletions t/mojo/user_agent_online.t
Expand Up @@ -95,7 +95,7 @@ is $tx->error, "Couldn't connect", 'right error';
# Fresh user agent again
$ua = Mojo::UserAgent->new;

# Keep alive
# Keep-alive
$ua->get('http://mojolicio.us' => sub { Mojo::IOLoop->singleton->stop });
Mojo::IOLoop->singleton->start;
my $kept_alive;
Expand All @@ -109,7 +109,7 @@ $ua->get(
Mojo::IOLoop->singleton->start;
ok $kept_alive, 'connection was kept alive';

# Nested keep alive
# Nested keep-alive
my @kept_alive;
$ua->get(
'http://mojolicio.us' => sub {
Expand All @@ -136,7 +136,7 @@ is_deeply \@kept_alive, [1, 1, 1], 'connections kept alive';
# Fresh user agent again
$ua = Mojo::UserAgent->new;

# Custom non keep alive request
# Custom non keep-alive request
$tx = Mojo::Transaction::HTTP->new;
$tx->req->method('GET');
$tx->req->url->parse('http://metacpan.org');
Expand Down Expand Up @@ -167,7 +167,7 @@ is $tx->req->method, 'GET', 'right method';
is $tx->req->url, 'http://google.com', 'right url';
is $tx->res->code, 301, 'right status';

# Simple keep alive requests
# Simple keep-alive requests
$tx = $ua->get('http://www.wikipedia.org');
is $tx->req->method, 'GET', 'right method';
is $tx->req->url, 'http://www.wikipedia.org', 'right url';
Expand Down Expand Up @@ -214,7 +214,7 @@ like $ua->ioloop->stream($tx->connection)
# Fresh user agent again
$ua = Mojo::UserAgent->new;

# Simple keep alive form POST
# Simple keep-alive form POST
$tx = $ua->post(
'http://search.cpan.org/search' => form => {query => 'mojolicious'});
is $tx->req->method, 'POST', 'right method';
Expand Down

0 comments on commit 3ac894c

Please sign in to comment.