Skip to content

Commit

Permalink
removed Bonjour support
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed May 27, 2012
1 parent 337c632 commit d0445e0
Show file tree
Hide file tree
Showing 50 changed files with 129 additions and 155 deletions.
1 change: 1 addition & 0 deletions Changes
@@ -1,6 +1,7 @@

2.97 2012-05-27
- Added workaround to make IO::Socket::SSL work with IO::Socket::IP.
- Removed Bonjour support.
- Improved documentation.
- Improved tests.
- Fixed bug that prevented Test::Mojo from working with normal Mojolicious
Expand Down
14 changes: 7 additions & 7 deletions README.pod
Expand Up @@ -3,9 +3,9 @@

Back in the early days of the web, many people learned Perl because of a
wonderful Perl library called L<CGI>. It was simple enough to get started
without knowing much about the language and powerful enough to keep you
going, learning by doing was much fun. While most of the techniques used are
outdated now, the idea behind it is not. L<Mojolicious> is a new attempt at
without knowing much about the language and powerful enough to keep you going,
learning by doing was much fun. While most of the techniques used are outdated
now, the idea behind it is not. L<Mojolicious> is a new attempt at
implementing this idea using state of the art technology.

=head2 Features
Expand Down Expand Up @@ -34,8 +34,8 @@ they are installed).

=item *

Full stack HTTP 1.1 and WebSocket client/server implementation with IPv6,
TLS, Bonjour, IDNA, Comet (long polling), chunking and multipart support.
Full stack HTTP 1.1 and WebSocket client/server implementation with IPv6, TLS,
IDNA, Comet (long polling), chunking and multipart support.

=item *

Expand Down Expand Up @@ -72,8 +72,8 @@ These three lines are a whole web application.

app->start;

To run this example with the built-in development web server just put the
code into a file and start it with C<morbo>.
To run this example with the built-in development web server just put the code
into a file and start it with C<morbo>.

$ morbo hello.pl
Server available at http://127.0.0.1:3000.
Expand Down
22 changes: 3 additions & 19 deletions lib/Mojo/Server/Daemon.pm
Expand Up @@ -6,12 +6,6 @@ use Mojo::IOLoop;
use Mojo::URL;
use POSIX;
use Scalar::Util 'weaken';
use Sys::Hostname;

# Bonjour
use constant BONJOUR => $ENV{MOJO_NO_BONJOUR}
? 0
: eval 'use Net::Rendezvous::Publish 0.04 (); 1';

use constant DEBUG => $ENV{MOJO_DAEMON_DEBUG} || 0;

Expand Down Expand Up @@ -192,16 +186,6 @@ sub _listen {
);
push @{$self->{listening} ||= []}, $id;

# Bonjour
if (BONJOUR && (my $p = Net::Rendezvous::Publish->new)) {
my $name = $options->{address} || Sys::Hostname::hostname();
$p->publish(
name => "Mojolicious ($name:$options->{port})",
port => $options->{port},
type => '_http._tcp'
) if $options->{port} && !$tls;
}

# Friendly message
return if $self->silent;
$self->app->log->info(qq{Listening at "$listen".});
Expand Down Expand Up @@ -312,12 +296,12 @@ Mojo::Server::Daemon - Non-blocking I/O HTTP 1.1 and WebSocket server
=head1 DESCRIPTION
L<Mojo::Server::Daemon> is a full featured non-blocking I/O HTTP 1.1 and
WebSocket server with C<IPv6>, C<TLS>, C<Bonjour> and C<libev> support.
WebSocket server with C<IPv6>, C<TLS> and C<libev> support.
Optional modules L<EV>, L<IO::Socket::IP>, L<IO::Socket::SSL> and
L<Net::Rendezvous::Publish> are supported transparently and used if installed.
Individual features can also be disabled with the C<MOJO_NO_BONJOUR>,
C<MOJO_NO_IPV6> and C<MOJO_NO_TLS> environment variables.
Individual features can also be disabled with the C<MOJO_NO_IPV6> and
C<MOJO_NO_TLS> environment variables.
See L<Mojolicious::Guides::Cookbook> for deployment recipes.
Expand Down
8 changes: 4 additions & 4 deletions lib/Mojo/Server/Hypnotoad.pm
Expand Up @@ -366,8 +366,8 @@ Mojo::Server::Hypnotoad - ALL GLORY TO THE HYPNOTOAD!
L<Mojo::Server::Hypnotoad> is a full featured UNIX optimized preforking
non-blocking I/O HTTP 1.1 and WebSocket server built around the very well
tested and reliable L<Mojo::Server::Daemon> with C<IPv6>, C<TLS>, C<Bonjour>,
C<libev> and hot deployment support that just works.
tested and reliable L<Mojo::Server::Daemon> with C<IPv6>, C<TLS>, C<libev> and
hot deployment support that just works.
To start applications with it you can use the L<hypnotoad> script.
Expand All @@ -384,8 +384,8 @@ C<production> mode.
Optional modules L<EV>, L<IO::Socket::IP>, L<IO::Socket::SSL> and
L<Net::Rendezvous::Publish> are supported transparently and used if installed.
Individual features can also be disabled with the C<MOJO_NO_BONJOUR>,
C<MOJO_NO_IPV6> and C<MOJO_NO_TLS> environment variables.
Individual features can also be disabled with the C<MOJO_NO_IPV6> and
C<MOJO_NO_TLS> environment variables.
See L<Mojolicious::Guides::Cookbook> for deployment recipes.
Expand Down
7 changes: 3 additions & 4 deletions lib/Mojo/Server/Morbo.pm
Expand Up @@ -123,8 +123,7 @@ Mojo::Server::Morbo - DOOOOOOOOOOOOOOOOOOM!
L<Mojo::Server::Morbo> is a full featured self-restart capable non-blocking
I/O HTTP 1.1 and WebSocket server built around the very well tested and
reliable L<Mojo::Server::Daemon> with C<IPv6>, C<TLS>, C<Bonjour> and C<libev>
support.
reliable L<Mojo::Server::Daemon> with C<IPv6>, C<TLS> and C<libev> support.
To start applications with it you can use the L<morbo> script.
Expand All @@ -133,8 +132,8 @@ To start applications with it you can use the L<morbo> script.
Optional modules L<EV>, L<IO::Socket::IP>, L<IO::Socket::SSL> and
L<Net::Rendezvous::Publish> are supported transparently and used if installed.
Individual features can also be disabled with the C<MOJO_NO_BONJOUR>,
C<MOJO_NO_IPV6> and C<MOJO_NO_TLS> environment variables.
Individual features can also be disabled with the C<MOJO_NO_IPV6> and
C<MOJO_NO_TLS> environment variables.
See L<Mojolicious::Guides::Cookbook> for deployment recipes.
Expand Down
7 changes: 0 additions & 7 deletions lib/Mojolicious/Command/version.pm
Expand Up @@ -24,12 +24,6 @@ sub run {
my $tls
= Mojo::IOLoop::Server::TLS ? $IO::Socket::SSL::VERSION : 'not installed';

# Bonjour
my $bonjour
= Mojo::Server::Daemon::BONJOUR
? $Net::Rendezvous::Publish::VERSION
: 'not installed';

print <<"EOF";
CORE
Perl ($^V, $^O)
Expand All @@ -39,7 +33,6 @@ OPTIONAL
EV ($ev)
IO::Socket::IP ($ipv6)
IO::Socket::SSL ($tls)
Net::Rendezvous::Publish ($bonjour)
EOF

Expand Down
4 changes: 2 additions & 2 deletions t/mojo/app.t
@@ -1,8 +1,8 @@
use Mojo::Base -strict;

# Disable Bonjour, IPv6 and libev
# Disable IPv6 and libev
BEGIN {
$ENV{MOJO_NO_BONJOUR} = $ENV{MOJO_NO_IPV6} = 1;
$ENV{MOJO_NO_IPV6} = 1;
$ENV{MOJO_REACTOR} = 'Mojo::Reactor::Poll';
}

Expand Down
4 changes: 2 additions & 2 deletions t/mojo/delay.t
@@ -1,8 +1,8 @@
use Mojo::Base -strict;

# Disable Bonjour, IPv6 and libev
# Disable IPv6 and libev
BEGIN {
$ENV{MOJO_NO_BONJOUR} = $ENV{MOJO_NO_IPV6} = 1;
$ENV{MOJO_NO_IPV6} = 1;
$ENV{MOJO_REACTOR} = 'Mojo::Reactor::Poll';
}

Expand Down
4 changes: 2 additions & 2 deletions t/mojo/hypnotoad.t
@@ -1,8 +1,8 @@
use Mojo::Base -strict;

# Disable Bonjour, IPv6 and libev
# Disable IPv6 and libev
BEGIN {
$ENV{MOJO_NO_BONJOUR} = $ENV{MOJO_NO_IPV6} = 1;
$ENV{MOJO_NO_IPV6} = 1;
$ENV{MOJO_REACTOR} = 'Mojo::Reactor::Poll';
}

Expand Down
4 changes: 2 additions & 2 deletions t/mojo/ioloop.t
@@ -1,8 +1,8 @@
use Mojo::Base -strict;

# Disable Bonjour, IPv6 and libev
# Disable IPv6 and libev
BEGIN {
$ENV{MOJO_NO_BONJOUR} = $ENV{MOJO_NO_IPV6} = 1;
$ENV{MOJO_NO_IPV6} = 1;
$ENV{MOJO_REACTOR} = 'Mojo::Reactor::Poll';
}

Expand Down
7 changes: 2 additions & 5 deletions t/mojo/ioloop_ipv6.t
@@ -1,10 +1,7 @@
use Mojo::Base -strict;

# Disable Bonjour and libev
BEGIN {
$ENV{MOJO_NO_BONJOUR} = 1;
$ENV{MOJO_REACTOR} = 'Mojo::Reactor::Poll';
}
# Disable libev
BEGIN { $ENV{MOJO_REACTOR} = 'Mojo::Reactor::Poll' }

use Test::More;
use Mojo::IOLoop::Server;
Expand Down
4 changes: 2 additions & 2 deletions t/mojo/ioloop_tls.t
@@ -1,8 +1,8 @@
use Mojo::Base -strict;

# Disable Bonjour, IPv6 and libev
# Disable IPv6 and libev
BEGIN {
$ENV{MOJO_NO_BONJOUR} = $ENV{MOJO_NO_IPV6} = 1;
$ENV{MOJO_NO_IPV6} = 1;
$ENV{MOJO_REACTOR} = 'Mojo::Reactor::Poll';
}

Expand Down
4 changes: 2 additions & 2 deletions t/mojo/morbo.t
@@ -1,8 +1,8 @@
use Mojo::Base -strict;

# Disable Bonjour, IPv6 and libev
# Disable IPv6 and libev
BEGIN {
$ENV{MOJO_NO_BONJOUR} = $ENV{MOJO_NO_IPV6} = 1;
$ENV{MOJO_NO_IPV6} = 1;
$ENV{MOJO_REACTOR} = 'Mojo::Reactor::Poll';
}

Expand Down
4 changes: 2 additions & 2 deletions t/mojo/reactor_ev.t
@@ -1,7 +1,7 @@
use Mojo::Base -strict;

# Disable Bonjour and IPv6
BEGIN { $ENV{MOJO_NO_BONJOUR} = $ENV{MOJO_NO_IPV6} = 1 }
# Disable IPv6
BEGIN { $ENV{MOJO_NO_IPV6} = 1 }

use Test::More;
plan skip_all => 'set TEST_EV to enable this test (developer only!)'
Expand Down
4 changes: 2 additions & 2 deletions t/mojo/reactor_poll.t
@@ -1,8 +1,8 @@
use Mojo::Base -strict;

# Disable Bonjour, IPv6 and libev
# Disable IPv6 and libev
BEGIN {
$ENV{MOJO_NO_BONJOUR} = $ENV{MOJO_NO_IPV6} = 1;
$ENV{MOJO_NO_IPV6} = 1;
$ENV{MOJO_REACTOR} = 'Mojo::Reactor::Poll';
}

Expand Down
4 changes: 2 additions & 2 deletions t/mojo/user_agent.t
@@ -1,8 +1,8 @@
use Mojo::Base -strict;

# Disable Bonjour, IPv6, TLS and libev
# Disable IPv6, TLS and libev
BEGIN {
$ENV{MOJO_NO_BONJOUR} = $ENV{MOJO_NO_IPV6} = $ENV{MOJO_NO_TLS} = 1;
$ENV{MOJO_NO_IPV6} = $ENV{MOJO_NO_TLS} = 1;
$ENV{MOJO_REACTOR} = 'Mojo::Reactor::Poll';
}

Expand Down
4 changes: 2 additions & 2 deletions t/mojo/user_agent_tls.t
@@ -1,8 +1,8 @@
use Mojo::Base -strict;

# Disable Bonjour, IPv6 and libev
# Disable IPv6 and libev
BEGIN {
$ENV{MOJO_NO_BONJOUR} = $ENV{MOJO_NO_IPV6} = 1;
$ENV{MOJO_NO_IPV6} = 1;
$ENV{MOJO_REACTOR} = 'Mojo::Reactor::Poll';
}

Expand Down
4 changes: 2 additions & 2 deletions t/mojo/websocket.t
@@ -1,8 +1,8 @@
use Mojo::Base -strict;

# Disable Bonjour, IPv6 and libev
# Disable IPv6 and libev
BEGIN {
$ENV{MOJO_NO_BONJOUR} = $ENV{MOJO_NO_IPV6} = 1;
$ENV{MOJO_NO_IPV6} = 1;
$ENV{MOJO_REACTOR} = 'Mojo::Reactor::Poll';
}

Expand Down
4 changes: 2 additions & 2 deletions t/mojo/websocket_proxy.t
@@ -1,8 +1,8 @@
use Mojo::Base -strict;

# Disable Bonjour, IPv6 and libev
# Disable IPv6 and libev
BEGIN {
$ENV{MOJO_NO_BONJOUR} = $ENV{MOJO_NO_IPV6} = 1;
$ENV{MOJO_NO_IPV6} = 1;
$ENV{MOJO_REACTOR} = 'Mojo::Reactor::Poll';
}

Expand Down
4 changes: 2 additions & 2 deletions t/mojo/websocket_proxy_tls.t
@@ -1,8 +1,8 @@
use Mojo::Base -strict;

# Disable Bonjour, IPv6 and libev
# Disable IPv6 and libev
BEGIN {
$ENV{MOJO_NO_BONJOUR} = $ENV{MOJO_NO_IPV6} = 1;
$ENV{MOJO_NO_IPV6} = 1;
$ENV{MOJO_REACTOR} = 'Mojo::Reactor::Poll';
}

Expand Down
8 changes: 4 additions & 4 deletions t/mojolicious/app.t
@@ -1,10 +1,10 @@
use Mojo::Base -strict;

# Disable Bonjour, IPv6 and libev
# Disable IPv6 and libev
BEGIN {
$ENV{MOJO_MODE} = 'development';
$ENV{MOJO_NO_BONJOUR} = $ENV{MOJO_NO_IPV6} = 1;
$ENV{MOJO_REACTOR} = 'Mojo::Reactor::Poll';
$ENV{MOJO_MODE} = 'development';
$ENV{MOJO_NO_IPV6} = 1;
$ENV{MOJO_REACTOR} = 'Mojo::Reactor::Poll';
}

use Test::More tests => 325;
Expand Down
4 changes: 2 additions & 2 deletions t/mojolicious/caching_lite_app.t
@@ -1,8 +1,8 @@
use Mojo::Base -strict;

# Disable Bonjour, IPv6 and libev
# Disable IPv6 and libev
BEGIN {
$ENV{MOJO_NO_BONJOUR} = $ENV{MOJO_NO_IPV6} = 1;
$ENV{MOJO_NO_IPV6} = 1;
$ENV{MOJO_REACTOR} = 'Mojo::Reactor::Poll';
}

Expand Down
4 changes: 2 additions & 2 deletions t/mojolicious/charset_lite_app.t
Expand Up @@ -2,9 +2,9 @@ use Mojo::Base -strict;

use utf8;

# Disable Bonjour, IPv6 and libev
# Disable IPv6 and libev
BEGIN {
$ENV{MOJO_NO_BONJOUR} = $ENV{MOJO_NO_IPV6} = 1;
$ENV{MOJO_NO_IPV6} = 1;
$ENV{MOJO_REACTOR} = 'Mojo::Reactor::Poll';
}

Expand Down
4 changes: 2 additions & 2 deletions t/mojolicious/dispatcher_lite_app.t
@@ -1,8 +1,8 @@
use Mojo::Base -strict;

# Disable Bonjour, IPv6 and libev
# Disable IPv6 and libev
BEGIN {
$ENV{MOJO_NO_BONJOUR} = $ENV{MOJO_NO_IPV6} = 1;
$ENV{MOJO_NO_IPV6} = 1;
$ENV{MOJO_REACTOR} = 'Mojo::Reactor::Poll';
}

Expand Down
8 changes: 4 additions & 4 deletions t/mojolicious/embedded_app.t
Expand Up @@ -2,11 +2,11 @@ use Mojo::Base -strict;

use utf8;

# Disable Bonjour, IPv6 and libev
# Disable IPv6 and libev
BEGIN {
$ENV{MOJO_MODE} = 'testing';
$ENV{MOJO_NO_BONJOUR} = $ENV{MOJO_NO_IPV6} = 1;
$ENV{MOJO_REACTOR} = 'Mojo::Reactor::Poll';
$ENV{MOJO_MODE} = 'testing';
$ENV{MOJO_NO_IPV6} = 1;
$ENV{MOJO_REACTOR} = 'Mojo::Reactor::Poll';
}

use Test::More tests => 39;
Expand Down
8 changes: 4 additions & 4 deletions t/mojolicious/embedded_lite_app.t
Expand Up @@ -2,11 +2,11 @@ use Mojo::Base -strict;

use utf8;

# Disable Bonjour, IPv6 and libev
# Disable IPv6 and libev
BEGIN {
$ENV{MOJO_MODE} = 'testing';
$ENV{MOJO_NO_BONJOUR} = $ENV{MOJO_NO_IPV6} = 1;
$ENV{MOJO_REACTOR} = 'Mojo::Reactor::Poll';
$ENV{MOJO_MODE} = 'testing';
$ENV{MOJO_NO_IPV6} = 1;
$ENV{MOJO_REACTOR} = 'Mojo::Reactor::Poll';
}

use Test::More tests => 139;
Expand Down

0 comments on commit d0445e0

Please sign in to comment.