Bug#437474: libnet-irc-perl patches

Niko Tyni ntyni at iki.fi
Sun Aug 12 19:34:13 UTC 2007


Package: libnet-irc-perl
Version: 0.75-6
Severity: normal

Hi David,

thanks for your patches. I'm forwarding them to the Debian bug tracking
system, so we can better keep track of them. Please keep the bug
address (xxxxxx at bugs.debian.org, I don't know the number yet) Cc'd.

When is the first patch ('fix_ev_has_null_type.patch') needed?  Is it
when the server sends an unknown numeric response, or is some part of
the code calling handler() with an empty string?

The second patch ('fix_next_outside_loop_with_return.patch')
looks good to me.

I'm not sure of the third one ('fix_send_on_unexpected_close.patch').
If the server has closed the connection, shouldn't we trigger a
'sockerror' event before failing?

----- Forwarded message from David Sobon <dsobon at gmail.com> -----

From: David Sobon <dsobon at gmail.com>
To: ntyni at iki.fi
Subject: libnet-irc-perl patches

Hello,
    I think you may be the most appropriate person for receiving
submitted patches related to libnet-irc-perl. I tried to send patches
many years ago to the former maintainer, or even the original Net::IRC
contact address, but nothing came out of it.

Unfortunately I lost one patch that related to DCC CHAT line
handling... so I cannot provide a fix I had created a few years ago.
(I can probably try one of my old scripts that exposed the problem)

The patches only solve warnings basically. If the patches do not
appear to solve a convincing issue, I can, with effort, to reproduce
the warning messages.

Patches are as attached with self-descriptive filename.

Thanks.

-David.

--- Connection.pm.orig	2004-12-17 08:18:48.000000000 +0800
+++ Connection.pm	2007-08-12 18:40:22.000000000 +0800
@@ -473,6 +473,10 @@
   } else {
     croak "Not enough arguments to handler()";
   }
+
+  unless ($ev) {
+    croak "event has NULL type!";
+  }
   
   print STDERR "Trying to handle event '$ev'.\n" if $self->{_debug};
   

--- DCC.pm.orig	2006-10-04 04:49:54.000000000 +0800
+++ DCC.pm	2007-08-12 18:32:46.000000000 +0800
@@ -253,7 +253,8 @@
 
     my $line = $self->_getline($_[0], 'BLOCKS');
 
-    next unless defined $line;
+    return unless defined $line;
+
     unless(print {$self->{_fh}} $line) {
 	carp ("Error writing to " . $self->{_filename} . ": $!");
 	close $self->{_fh};

--- Connection.pm.orig	2004-12-17 08:18:48.000000000 +0800
+++ Connection.pm	2007-08-12 18:40:22.000000000 +0800
@@ -1374,7 +1378,11 @@
   if ($self->{_debug}) {
     print ">>> $line\n";
   }
-  
+
+  # sometimes IRC servers unexpectedly close on connect, so we try to send
+  # to a closed socket. dodgy IRC server software?
+  return unless ($self->{_socket});
+
   # RFC compliance can be kinda nice...
   my $rv = $self->ssl ?
       $self->socket->print("$line\015\012") :


----- End forwarded message -----

Cheers,
-- 
Niko Tyni   ntyni at iki.fi




More information about the pkg-perl-maintainers mailing list