Phil H�hn wrote:I'm actually modifying the code in contentAreaUtils.js - when I started this message thread I thought I'd try to leave out stuff like that to simplify the question but maybe I made it worse ;-)Heh. ;)So the 'this' value is (should be!) a different nsHeaderSniffer object in each case.Right.So sometimes it seems the nsIRequestObserver::onStopRequest(...) - which the nsHeaderSniffer object implements - is only serviced once, by the latter instance that is created.Hmm... Does that happen in a vanilla trunk build? If so, what are the steps to reproduce? If not, is there a patch that needs to be applied to reproduce this?
-Boris
Oops, sorry for the delay (and getting the most recent tarball on a 56k modem is always slow ;-) )... Compiled tarball from 14.04.2004, all a-ok, working as expected.
So I went ahead with a small mod to break things. In mozilla\xpfe\communicator\resources\content, edit contentAreaUtils.js, replace the contents of the following method with what I have here:
function saveDocument(aDocument)
{
var browser = getBrowser();
var thisBrowser = browser.browsers[0];
var ref = thisBrowser.contentDocument.location.href;
var doc = thisBrowser.docShell.document;//null;//
saveInternal(ref, doc, false);
thisBrowser = browser.browsers[1];
ref = thisBrowser.contentDocument.location.href;
doc = thisBrowser.docShell.document;//null;//
saveInternal(ref, doc, false);
}Do a debug rebuild, then when you run the code, make sure you have 2 pages (2 tabs) open, then right-click and select 'save page as'. Two dialogs pop up (i.e one for each tab) - very quickly click save in both of them. If both are running at the same time all sorts of errors can occur, for example an error reporting 'code not reached' followed by an empty (and seemingly orphaned) download dialog. Sometimes there are many errors but both pages are saved (and sometimes not).
Whether errors occur may depend on the speed of your system, luck, and how fast you click in the save-as dialogs (I'm running a 2.6G P4 with 512M on XP SP1).
Of course the code I was working on has more smarts (eg checking whether browser 2 exists) and actually suppressing the save-as dialog (which can make the problem more pronounced). However the simple change above is enough to cause the problem.
If you can tell me what needs to happen to make the above reliable then I'd be very greatful (and I'd probably be able to incorporate the change into my full-blown code).
Thanx _______________________________________________ Mozilla-netlib mailing list [EMAIL PROTECTED] http://mail.mozilla.org/listinfo/mozilla-netlib
