http://bugzilla.spamassassin.org/show_bug.cgi?id=4176





------- Additional Comments From [EMAIL PROTECTED]  2005-05-05 10:27 -------
Sidney --

yep, it really is that simple ;)  it's unfortunate that it has to be passed
through, but given that the HTML parsing (a complex step that requires access to
configuration) takes place at the end of those 3 objects, I think it's
unavoidable.  we've had to do this in the past, too, on other objects.

this btw is why I generally set {main} on objects, even if it's not used
immediately -- it may be useful down the line...

it may be simpler if you can pass a $main directly from one method call to
another, instead of having to set $self->{main} and then have a $self->finish()
method to clean it up later.  that really depends on the call flow though.

another simpler option would be to refactor so that the HTML parsing can take
place from another class that *does* know {main}.  but I think that would be
much more intrusive and damaging, would break encapsulation by moving HTML
parsing away from the data it's working on (the Node object), and generally
doesn't make sense since this isn't a big deal.

'What I'm most concerned about is how this relates to the loading the per-user
conf and the copying of the configiguration for the child processes in spamd.
Does anything special have to be done in passing the 'main' pointer in to the
Message object to Node to HTML because of that?'

nope.  the 'main' pointer never changes between user scans -- instead the
$main->{conf} object reference does.   So as long as you store the main ptr via
"$self->{main} = $main" and access via "$self->{main}->{conf}", instead of
taking a copy of the pointer a la "$self->{conf} = $main->{conf}" and then using
"$self->{conf}" later, you'll be OK.



------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.

Reply via email to