X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=scpubgit%2FObject-Remote.git;a=blobdiff_plain;f=lib%2FObject%2FRemote%2FConnection.pm;h=d338a21b6b4bcb8ad9bb4add3782a26a4eec351f;hp=b051b0be14c88be13ed98de2c8609c11abf042b0;hb=6b7b2732b7cc6b6c626469f2e6300b7012caef07;hpb=9031635d18e754da303557b656c63ce8e7eb8e77 diff --git a/lib/Object/Remote/Connection.pm b/lib/Object/Remote/Connection.pm index b051b0b..d338a21 100644 --- a/lib/Object/Remote/Connection.pm +++ b/lib/Object/Remote/Connection.pm @@ -24,14 +24,18 @@ has _id => ( is => 'ro', required => 1, default => sub { our $NEXT_CONNECTION_ID has send_to_fh => ( is => 'ro', required => 1, - trigger => sub { $_[1]->autoflush(1) }, + trigger => sub { + my $self = $_[0]; + $_[1]->autoflush(1); + Dlog_trace { my $id = $self->_id; "connection had send_to_fh set to $_" } $_[1]; + }, ); has read_channel => ( is => 'ro', required => 1, trigger => sub { my ($self, $ch) = @_; - Dlog_trace { "trigger for read_channel has been invoked for connection $_" } $self->_id; + Dlog_trace { my $id = $self->_id; "trigger for read_channel has been invoked for connection $id; file handle is " } $ch->fh; weaken($self); $ch->on_line_call(sub { $self->_receive(@_) }); $ch->on_close_call(sub { $self->on_close->done(@_) }); @@ -235,7 +239,7 @@ sub _send { my $fh = $self->send_to_fh; Dlog_trace { "Starting to serialize data in argument to _send for connection $_" } $self->_id; my $serialized = $self->_serialize($to_send)."\n"; - Dlog_debug { my $l = length($serialized); "serialization is completed; sending '$l' characters of serialized data to $_" } $fh; + Dlog_trace { my $l = length($serialized); "serialization is completed; sending '$l' characters of serialized data to $_" } $fh; #TODO this is very risky for deadlocks unless it's set to non-blocking and then with out extra #logic it could easily do short-writes to the remote side my $ret = print $fh $serialized; @@ -248,7 +252,6 @@ sub _send { sub _serialize { my ($self, $data) = @_; local our @New_Ids = (-1); - Dlog_debug { "starting to serialize data for connection $_" } $self->_id; return eval { my $flat = $self->_encode($self->_deobjectify($data)); warn "$$ >>> ${flat}\n" if $DEBUG;