diff options
author | Eric Wong <e@80x24.org> | 2019-06-24 02:52:03 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2019-06-24 05:26:25 +0000 |
commit | 8c619bae62a3d468505716d58d3559278883eee7 (patch) | |
tree | 5c49660fcf44f5f805d41a67d0005f9b08bba37f /lib/PublicInbox/DS.pm | |
parent | 740d274818d7af9c50c8609a05860817e6aa9680 (diff) | |
download | public-inbox-8c619bae62a3d468505716d58d3559278883eee7.tar.gz |
Over a decade of using Danga::Socket and I never found the built-in debug functionality useful.
Diffstat (limited to 'lib/PublicInbox/DS.pm')
-rw-r--r-- | lib/PublicInbox/DS.pm | 69 |
1 files changed, 0 insertions, 69 deletions
diff --git a/lib/PublicInbox/DS.pm b/lib/PublicInbox/DS.pm index f4fe8793..9e24ed78 100644 --- a/lib/PublicInbox/DS.pm +++ b/lib/PublicInbox/DS.pm @@ -34,8 +34,6 @@ use fields ('sock', # underlying socket use Errno qw(EAGAIN EINVAL); use Carp qw(croak confess); -use constant DebugLevel => 0; - use constant POLLIN => 1; use constant POLLOUT => 4; use constant POLLERR => 8; @@ -105,18 +103,6 @@ sub SetLoopTimeout { return $LoopTimeout = $_[1] + 0; } -=head2 C<< CLASS->DebugMsg( $format, @args ) >> - -Print the debugging message specified by the C<sprintf>-style I<format> and -I<args> - -=cut -sub DebugMsg { - my ( $class, $fmt, @args ) = @_; - chomp $fmt; - printf STDERR ">>> $fmt\n", @args; -} - =head2 C<< CLASS->AddTimer( $seconds, $coderef ) >> Add a timer to occur $seconds from now. $seconds may be fractional, but timers @@ -487,16 +473,6 @@ sub close { return 0; } -=head2 C<< $obj->sock() >> - -Returns the underlying IO::Handle for the object. - -=cut -sub sock { - my PublicInbox::DS $self = shift; - return $self->{sock}; -} - =head2 C<< $obj->write( $data ) >> Write the specified data to the underlying handle. I<data> may be scalar, @@ -671,51 +647,6 @@ sub watch_write { } } -=head2 C<< $obj->dump_error( $message ) >> - -Prints to STDERR a backtrace with information about this socket and what lead -up to the dump_error call. - -=cut -sub dump_error { - my $i = 0; - my @list; - while (my ($file, $line, $sub) = (caller($i++))[1..3]) { - push @list, "\t$file:$line called $sub\n"; - } - - warn "ERROR: $_[1]\n" . - "\t$_[0] = " . $_[0]->as_string . "\n" . - join('', @list); -} - -=head2 C<< $obj->debugmsg( $format, @args ) >> - -Print the debugging message specified by the C<sprintf>-style I<format> and -I<args>. - -=cut -sub debugmsg { - my ( $self, $fmt, @args ) = @_; - confess "Not an object" unless ref $self; - - chomp $fmt; - printf STDERR ">>> $fmt\n", @args; -} - -=head2 C<< $obj->as_string() >> - -Returns a string describing this socket. - -=cut -sub as_string { - my PublicInbox::DS $self = shift; - my $rw = "(" . ($self->{event_watch} & POLLIN ? 'R' : '') . - ($self->{event_watch} & POLLOUT ? 'W' : '') . ")"; - my $ret = ref($self) . "$rw: " . ($self->{sock} ? 'open' : 'closed'); - return $ret; -} - package PublicInbox::DS::Timer; # [$abs_float_firetime, $coderef]; sub cancel { |