DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUGĀ·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=38795>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED ANDĀ·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=38795





------- Additional Comments From [EMAIL PROTECTED]  2006-03-16 04:38 -------
Created an attachment (id=17909)
 --> (http://issues.apache.org/bugzilla/attachment.cgi?id=17909&action=view)
Defensive coding patch for all bind/unbind usage NEEDS PEER REVIEW

This is a patch base on a code walk (rather than a full understanding of the
code) and some re-work to eliminate potential problem that seem possible from
the perspective of that code walk.

Namely protection from Exception generation at the wrong moment between
bind/unbind calls.


There are two minor changes in behaviour with this patch, which I think are
more correct than the original (but then I didn't take the time the fully
understand the code so please excuse me).

#start() around line 4063 if ok==false we don't call bindThread() now.  Since
the only way we get to call unbind is in the finally block within the if(ok)
condition.  The means the code around line 4155 to 4166 may or may not be in
bound state, depending upon ok==true|false, was this originally intended ?

#start() around line if unbindThread(oldCC) were to throw an exception, before
we would call unbindThread(oldCC) again, twice in a row, maybe this is safe
anyway but now we only call it the once.

#stop() as the bug report suggests wrapping all the calls within the try block
make defensive sense to me.


Other than that for the normal code path execution should be the same as
before, but nows its very easy to see from the code that flipping between bind
and unbind is better protected from exceptions.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to