Subject: | [PATCH] Pass parameter hash to Plack's server_ready callback |
Otherwise, plackup can't tell the user where to connect to.
Subject: | 0001-Pass-parameter-hash-to-Plack-s-server_ready-callback.patch |
From 60cd0a3cb8c326533c857f973dc952e075ffb938 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Dagfinn=20Ilmari=20Manns=C3=A5ker?= <ilmari@ilmari.org>
Date: Tue, 17 Dec 2013 17:20:39 +0000
Subject: [PATCH] Pass parameter hash to Plack's server_ready callback
Otherwise, plackup can't tell the user where to connect to.
---
lib/Plack/Handler/Net/Async/HTTP/Server.pm | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/lib/Plack/Handler/Net/Async/HTTP/Server.pm b/lib/Plack/Handler/Net/Async/HTTP/Server.pm
index 2e9cb98..c1de9ed 100644
--- a/lib/Plack/Handler/Net/Async/HTTP/Server.pm
+++ b/lib/Plack/Handler/Net/Async/HTTP/Server.pm
@@ -84,7 +84,13 @@ sub run
socktype => "stream",
queuesize => $queuesize,
- on_notifier => sub { $self->{server_ready} and $self->{server_ready}->() },
+ on_notifier => sub {
+ $self->{server_ready}->({
+ host => $host,
+ port => $service,
+ server_software => ref($self),
+ }) if $self->{server_ready};
+ },
on_resolve_error => sub {
die "Cannot resolve - $_[-1]\n";
--
1.8.5