mCurNode was null, this causes Next to just return NS_OK, but doesn't advance anything. The loop isn't checking the return value for GetCurrentNode, and I think that's where the problem lies. I got this while replying to a message with an attachment. It might be other factors, but the issue in the code seems to be pretty clear. I was using a build from a pull of CVS around 7/28/03.
Created attachment 129204 [details] [diff] [review] Addresses CurrentNode failure resulting in an endless loop and reorganizes things a bit I reorganized this a bit, removing the extra call to CurrentNode. I think moving this to a for loop pattern makes it a little more straightforward. Someone who's a little more familiar with nsIContentIterator needs to double check the changes. The one difference is that IsDone is going to get called before the CurrentNode, but I don't think that's going to hurt anything.
ait a minute. Yuo found a case where the the iterator is inited, says there is no current node, but also says it is not done? That's an iterator bug. We should fix that instead of changing this code. Can you provide a testcase?
ugh. my typing....
I'm not sure I have a definitive test case. I was replying to a message containing HMTL and had an attachment. Replying to a plain text message didn't cause a problem. It may very well be a timing issue.