--- deliantra/server/ext/tcp.ext 2010/03/16 20:37:54 1.15 +++ deliantra/server/ext/tcp.ext 2010/05/09 21:46:39 1.18 @@ -1,4 +1,4 @@ -#! perl # MANDATORY +#! perl # mandatory # this listens for new tcp connections and hands them over to the server core # wether this being an extension introduces or reduces stability problems @@ -12,13 +12,17 @@ for (@$BIND) { my ($host, $port) = @$_; - warn "listening on ", (format_hostport $host, $port), "\n"; + cf::info "listening on ", (format_hostport $host, $port), "\n"; push @LISTENERS, tcp_server $host, $port, sub { my ($fh, $host, $port) = @_ or return; - warn "new connection from ", (format_hostport $host, $port), "\n"; + my $lhost = AnyEvent::Socket::format_address + +(AnyEvent::Socket::unpack_sockaddr getsockname $fh)[1]; + + cf::info "new connection from ", (format_hostport $host, $port), "\n" + if $lhost ne $host; # do not log connections from the host, e.g. for watchdogs cf::client::create fileno $fh, $host; };