[SCM] libmessage-passing-perl Debian packaging branch, master, updated. debian/0.111-3-14-g44f6e88

Tomas Doran tomas.doran at timgroup.com
Mon May 6 11:57:45 UTC 2013


The following commit has been merged in the master branch:
commit f9c0aef15b50d019ed71d5a68210dad02b4e8ffe
Author: Tomas Doran <tomas.doran at timgroup.com>
Date:   Mon Sep 3 23:14:16 2012 +0100

    Make it actually work

diff --git a/lib/Message/Passing/Input/Socket/UDP.pm b/lib/Message/Passing/Input/Socket/UDP.pm
index 6734548..4eddd51 100644
--- a/lib/Message/Passing/Input/Socket/UDP.pm
+++ b/lib/Message/Passing/Input/Socket/UDP.pm
@@ -32,6 +32,11 @@ sub BUILD {
     $self->handle;
 }
 
+sub _send_data {
+    my ($self, $data, $from_addr) = @_;
+    $self->output_to->consume($data);
+}
+
 sub _build_handle {
     my $self = shift;
     weaken($self);
@@ -40,7 +45,8 @@ sub _build_handle {
         on_recv => sub {
             my ($data, $h, $from_addr) = @_;
             # The output can optionally drop from addr.
-            $self->output_to->consume($data, $from_addr);
+            warn "SEND $data";
+            $self->_send_data($data, $from_addr);
         },
         on_error => sub {
             my ($h, $fatal, $msg) = @_;
diff --git a/lib/Message/Passing/Input/Syslog/UDP.pm b/lib/Message/Passing/Input/Syslog/UDP.pm
index 19a3717..5d57c44 100644
--- a/lib/Message/Passing/Input/Syslog/UDP.pm
+++ b/lib/Message/Passing/Input/Syslog/UDP.pm
@@ -1,5 +1,7 @@
 package Message::Passing::Input::Syslog::UDP;
 use Moo;
+use MRO::Compat;
+use Time::ParseDate;
 use namespace::clean -except => 'meta';
 
 extends 'Message::Passing::Input::Socket::UDP';
@@ -21,19 +23,18 @@ our $SYSLOG_REGEXP = q|
 $
 |;
 
-sub filter {
-    my ( $self, $message ) = @_;
+sub _send_data {
+    my ( $self, $message, $from ) = @_;
     if ( $message =~ s/$SYSLOG_REGEXP//sx ) {
         my $time = $2 && parsedate("$2 $3 $4:$5:$6");
-        return {
+        $self->output_to->consume({
             time     => $time,
             pri      => $1,
             facility => int($1/8),
             severity => int($1%8),
-            msg      => $7,
-        };
+            message      => $7,
+        });
     }
-    return undef;
 }
 
 1;

-- 
libmessage-passing-perl Debian packaging



More information about the Pkg-perl-cvs-commits mailing list