On Sat, 2010-12-11 at 16:00 +0100, Marcel Holtmann wrote:
> > But PacRunner doesn't *know* that ConnMan is running, and doesn't know
> > to *wait* for that information.
> > 
> > So it usually just returns 'direct://' for the first request that
> > activates it, even though that might be the wrong answer.
> > 
> > I'm not sure why it was done this way round. Shouldn't PacRunner have
> > been monitoring ConnMan, rather than vice versa? Then it would *know*
> > when it can start responding to requests.
> 
> we want it this way to make PACrunner also usable from NM and other
> connection manager daemons.

There are other ways to achieve that agnosticism. PACrunner could have
plugins which talk to ConnMan or NM. And which pick up proxy information
from /etc/sysconfig/proxy etc.
 
> And that race is known. I have this on my list of things to fix and
> mentioned this to everybody (including you) that this exists.

Yeah, but you may have noticed I'm trying to get PACrunner into working
shape right *now* so that we can get it into MeeGo. Hence trying to have
a coherent conversation about how to fix it.

> We need to delay the initial FindProxyByURL response a little bit to
> give ConnMan time to load the configuration. This is a one time trade
> off when the daemon starts.

A delay is not the right answer. For a start, it'll be delaying an HTTP
request that the user may well be *waiting* for. And most importantly
it's a race. We want to be event-driven and give a response when we know
we have the answer; not just wait a while and pray. We don't design
behaviour that way.

We need PACrunner to *know* as soon as it has all the information it's
going to get, and be able to start serving requests only then.

> We also need to do that anyway since downloading the PAC file might take
> time. Right now we also not handle that one nicely either.

Once we *know* there's a PAC file to be downloaded, and a download
outstanding, that one is easy enough. We set an 'update in progress'
flag, and proxy requests just get queued while we're waiting. Then
they're processed in a batch as soon as we get the completion event.
But again, event. Not delay and pray.

-- 
dwmw2

_______________________________________________
connman mailing list
[email protected]
http://lists.connman.net/listinfo/connman

Reply via email to