Fix crasher

Add missing 'use' and use get/set method for cleaner storage of QP object
This commit is contained in:
Jared Johnson 2014-09-15 15:34:58 -05:00
parent e9c56dc268
commit c6da8610dc
2 changed files with 4 additions and 2 deletions

View File

@ -5,6 +5,7 @@ use vars qw($TraceLevel $Spool_dir $Size_threshold);
use Sys::Hostname; use Sys::Hostname;
use Qpsmtpd::Constants; use Qpsmtpd::Constants;
use Qpsmtpd::Address;
our $VERSION = "0.94"; our $VERSION = "0.94";
@ -651,7 +652,7 @@ sub auth_mechanism {
sub address { sub address {
my $self = shift; my $self = shift;
my $addr = Qpsmtpd::Address->new(@_); my $addr = Qpsmtpd::Address->new(@_);
$addr->{qp} = $self; $addr->qp($self);
return $addr; return $addr;
} }

View File

@ -346,7 +346,8 @@ hook_user_config
=cut =cut
sub qp { sub qp {
my ($self) = @_; my $self = shift;
$self->{qp} = $_[0] if @_;
return $self->{qp}; return $self->{qp};
} }