Permalink
Browse files

tweaked debug messages a little more

  • Loading branch information...
kraih committed Apr 11, 2012
1 parent da96e39 commit 1bb10c5abddebebe4fa86b5deeb07132129ec70f
Showing with 5 additions and 5 deletions.
  1. +1 −1 lib/Mojo/Server/Daemon.pm
  2. +4 −4 lib/Mojo/UserAgent.pm
@@ -80,7 +80,6 @@ sub _build_tx {
my $handle = $self->ioloop->stream($id)->handle;
$tx->local_address($handle->sockhost)->local_port($handle->sockport);
$tx->remote_address($handle->peerhost)->remote_port($handle->peerport);
- warn "-- Accept connection (@{[$tx->remote_address]})\n" if DEBUG;
# TLS
$tx->req->url->base->scheme('https') if $c->{tls};
@@ -207,6 +206,7 @@ sub _listen {
# Add new connection
$self->{connections}->{$id} = {tls => $tls};
+ warn "-- Accept (@{[$stream->handle->peerhost]})\n" if DEBUG;
# Inactivity timeout
$stream->timeout($self->inactivity_timeout);
View
@@ -181,12 +181,12 @@ sub _cleanup {
sub _connect {
my ($self, $tx, $cb) = @_;
- # Cached connection
+ # Reuse connection
my $id = $tx->connection;
my ($scheme, $host, $port) = $self->transactor->endpoint($tx);
$id ||= $self->_cache("$scheme:$host:$port");
if ($id && !ref $id) {
- warn "-- Cached connection ($scheme:$host:$port)\n" if DEBUG;
+ warn "-- Reusing connection ($scheme:$host:$port)\n" if DEBUG;
$self->{connections}->{$id} = {cb => $cb, tx => $tx};
$tx->kept_alive(1) unless $tx->connection;
$self->_connected($id);
@@ -196,8 +196,8 @@ sub _connect {
# CONNECT request to proxy required
return if $tx->req->method ne 'CONNECT' && $self->_connect_proxy($tx, $cb);
- # New connection
- warn "-- New connection ($scheme:$host:$port)\n" if DEBUG;
+ # Connect
+ warn "-- Connect ($scheme:$host:$port)\n" if DEBUG;
($scheme, $host, $port) = $self->transactor->peer($tx);
weaken $self;
$id = $self->_loop->client(

0 comments on commit 1bb10c5

Please sign in to comment.