From 8b85efcfe87601fc74bbd1626e43589aaa759d25 Mon Sep 17 00:00:00 2001 From: Matt Sergeant Date: Fri, 17 Jun 2005 13:33:57 +0000 Subject: [PATCH] There's a hole in my bucket, dear Liza, dear Liza. There's a hole in my bucket, dear Liza, a hole. Go fix it, dear Henry, dear Henry, dear Henry. Go fix it, dear Henry, dear Henry, fix it. With what shall I fix it, dear Liza ... with what? With a patch from Joe Schaefer, dear Henry ... with a patch. git-svn-id: https://svn.perl.org/qpsmtpd/trunk@434 958fd67b-6ff1-0310-b445-bb7760255be9 --- lib/Apache/Qpsmtpd.pm | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/lib/Apache/Qpsmtpd.pm b/lib/Apache/Qpsmtpd.pm index 7efb1b1..1255107 100644 --- a/lib/Apache/Qpsmtpd.pm +++ b/lib/Apache/Qpsmtpd.pm @@ -6,23 +6,23 @@ use 5.006001; use strict; use warnings FATAL => 'all'; -use Apache::ServerUtil (); -use Apache::Connection (); -use Apache::Const -compile => qw(OK MODE_GETLINE); +use Apache2::ServerUtil (); +use Apache2::Connection (); +use Apache2::Const -compile => qw(OK MODE_GETLINE); use APR::Const -compile => qw(SO_NONBLOCK EOF SUCCESS); use APR::Error (); use APR::Brigade (); use APR::Bucket (); use APR::Socket (); -use Apache::Filter (); +use Apache2::Filter (); use ModPerl::Util (); # use Apache::TieBucketBrigade; our $VERSION = '0.02'; sub handler { - my Apache::Connection $c = shift; - $c->client_socket->opt_set(APR::SO_NONBLOCK => 0); + my Apache2::Connection $c = shift; + $c->client_socket->opt_set(APR::Const::SO_NONBLOCK => 0); my $qpsmtpd = Qpsmtpd::Apache->new(); $qpsmtpd->start_connection( @@ -35,7 +35,7 @@ sub handler { $qpsmtpd->run($c); - return Apache::OK; + return Apache2::Const::OK; } package Qpsmtpd::Apache; @@ -109,16 +109,16 @@ sub getline { my $bb = $self->{bb_in}; while (1) { - my $rc = $c->input_filters->get_brigade($bb, Apache::MODE_GETLINE); - return if $rc == APR::EOF; - die APR::Error::strerror($rc) unless $rc == APR::SUCCESS; + my $rc = $c->input_filters->get_brigade($bb, Apache2::Const::MODE_GETLINE); + return if $rc == APR::Const::EOF; + die APR::Error::strerror($rc) unless $rc == APR::Const::SUCCESS; my $data = ''; while (!$bb->is_empty) { my $b = $bb->first; - $b->remove; $b->read(my $newdata); - $data .= $newdata; + $b->delete; + $data .= $newdata; return $data if index($data, "\n") >= 0; } }