Skip to content
Browse files

Fix Server::Starter binding too

  • Loading branch information...
1 parent ec00ad9 commit adb8cdfafd8dceaea97ebbec08dc374d5a9faa79 @miyagawa committed Jan 28, 2011
Showing with 4 additions and 2 deletions.
  1. +4 −2 lib/Twiggy/Server/SS.pm
View
6 lib/Twiggy/Server/SS.pm
@@ -55,8 +55,10 @@ sub _create_ss_tcp_server {
Carp::croak "failed to bind to listening socket: $!";
fh_nonblocking $state{fh}, 1;
+ my($listen_host, $listen_port);
+
my $len;
- my $prepare = $self->_accept_prepare_handler;
+ my $prepare = $self->_accept_prepare_handler(\$listen_host, \$listen_port);
if ($prepare) {
my ($service, $host) = AnyEvent::Socket::unpack_sockaddr getsockname $state{fh};
$len = $prepare && $prepare->( $state{fh}, format_address $host, $service );
@@ -66,7 +68,7 @@ sub _create_ss_tcp_server {
listen $state{fh}, $len or Carp::croak "listen: $!";
- my $accept = $self->_accept_handler($app, $is_tcp);
+ my $accept = $self->_accept_handler($app, $is_tcp, \$listen_host, \$listen_port);
$state{aw} = AE::io $state{fh}, 0, sub {
# this closure keeps $state alive
while ($state{fh} && (my $peer = accept my $fh, $state{fh})) {

0 comments on commit adb8cdf

Please sign in to comment.
Something went wrong with that request. Please try again.