[Mimedefang] MySQL connection per slave
Chris Masters
rotis23 at yahoo.com
Mon Jul 14 06:34:00 EDT 2003
Thanks Jason,
that almost worked, but I had to call filter_init
within mimedefang.pl (which I really didn't want to
have to change).
I added:
if (defined(&filter_init)) {
filter_init();
}
just before the 'Infinite server loop' in the main
function. These are the only three lines that have
been added/changed. The database handle and connection
and disconnection code remain in mimedefang_filter.
I have used filter_cleanup to close the connection.
Now this does not address error conditions such as
disconnecting if the slave dies (make sure that
connections don't remain open) or how to re-connect if
the connection is lost during the slave lifecycle.
Chris
--- Jason Englander <jason at englanders.cc> wrote:
> On Thu, 10 Jul 2003, Chris Masters wrote:
>
> > I need to ammend the mimedefang code to maintain a
> > database connection per slave.
>
> One way would be to add a filter_init() subroutine
> to your filter
> (anywhere you like but outside of any other subs)
> like this:
>
> filter_init () {
> # Code to maintain a database connection per slave
> }
>
> Then right above this part of your filter (all the
> way at the bottom):
>
> # DO NOT delete the next line, or Perl will
> complain.
> 1;
>
> Add this:
>
> filter_init();
>
> And if you need to clean up things when the slave
> goes away, read about
> filter_cleanup() in the mimedefang-filter man page.
>
> Jason
>
> --
> Jason Englander <jason at englanders.cc>
> 394F 7E02 C105 7268 777A 3F5A 0AC0 C618 0675 80CA
>
> _______________________________________________
> MIMEDefang mailing list
> MIMEDefang at lists.roaringpenguin.com
>
http://lists.roaringpenguin.com/mailman/listinfo/mimedefang
__________________________________
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com
More information about the MIMEDefang
mailing list