Skip to content

Commit

Permalink
tweaked debug messages a little more
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Apr 11, 2012
1 parent da96e39 commit 1bb10c5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lib/Mojo/Server/Daemon.pm
Expand Up @@ -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};
Expand Down Expand Up @@ -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);
Expand Down
8 changes: 4 additions & 4 deletions lib/Mojo/UserAgent.pm
Expand Up @@ -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);
Expand All @@ -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(
Expand Down

0 comments on commit 1bb10c5

Please sign in to comment.