[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: Random note from TODO.021



On Mon, Nov 24, 2008 at 07:10:40PM +0000, Steven J. Murdoch wrote:
> I'll try some more combinations, and if I can't break it, I'll ship
> the next version with "AllowMultipleInstances=true". It's not perfect,
> but it seems better than the current situation.

I tried it, and it even made it into a release (1.1.5). Unfortunately
it has a problem, and so Jacob removed it in 1.1.6 :-(

The issue is that Vidalia relies on FirefoxPortable to know when
Firefox has exited. The way FirefoxPortable does this is to poll on
the process list, and when there are no "firefox.exe" applications
running, it exits. Vidalia detects this and exits itself (after
terminating Tor and Polipo).

This strategy obviously doesn't work when there are multiple instances
of Firefox running, hence FirefoxPortable simply waits until Firefox
exits, before exiting itself. 

This is generally fine, but sometimes Firefox does something, starts a
child process, and the parent exits. In these cases FirefoxPortable
exits along with the parent and so does Vidalia. The child Firefox
then appears, and finds that Tor has already exited.

What I'm currently doing is modifying Vidalia to be more intelligent
about when Firefox has exited. The trick will be to find the most
elegant and reliable way to tell when the Firefox it started has
exited, without becoming confused with other ones.

A nasty way would to rename the Firefox executable from firefox.exe
to something random, and then periodically check for this in the
process list. A more elegant approach would be to find the location
of the binary, and see if it is part of the TBB. Or maybe we can tell
from the process tree, which Firefox was started by Vidalia.

Steven.

-- 
w: http://www.cl.cam.ac.uk/users/sjm217/