Skip to content

Commit d52f003

Browse files
authored
Merge pull request #45 from catap/prefork
Call prefork_init and spamd_child_init when spawning child process.
2 parents 641e657 + b41ce6f commit d52f003

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

spampd.pl

+6
Original file line numberDiff line numberDiff line change
@@ -1214,13 +1214,19 @@ sub post_bind_hook {
12141214
sub pre_fork_hook {
12151215
return if $_[1]; # && $_[1] eq 'dequeue';
12161216
++$_[0]->{spampd}->{runtime_stats}->{child_count};
1217+
($_[0]->{spampd}->{sa_version} >= 3) and eval {
1218+
$_[0]->{assassin}->call_plugins("prefork_init");
1219+
}
12171220
}
12181221

12191222
# Net::Server hook: new child starting
12201223
sub child_init_hook {
12211224
return if $_[1]; # && $_[1] eq 'dequeue';
12221225
# set process name to help clarify via process listing which is child/parent
12231226
$_[0]->update_child_name();
1227+
($_[0]->{spampd}->{sa_version} >= 3) and eval {
1228+
$_[0]->{assassin}->call_plugins("spamd_child_init");
1229+
}
12241230
}
12251231

12261232
# Net::Server hook: about to exit child process

0 commit comments

Comments
 (0)