Hi Mohamed,
On Mon, Dec 13, 2010 at 03:03:57PM -0800, mohamed abbas wrote:
> Hi Samuel
>
>
> > Nice catch. Couldn't we fix that with that patch:
> >
> > diff --git a/src/service.c b/src/service.c
> > index 626cd31..5c692df 100644
> > --- a/src/service.c
> > +++ b/src/service.c
> > @@ -306,6 +306,9 @@ static connman_bool_t is_connecting(struct
> > connman_service *service)
> > switch (service->state) {
> > case CONNMAN_SERVICE_STATE_UNKNOWN:
> > case CONNMAN_SERVICE_STATE_IDLE:
> > + if (service->network == NULL)
> > + return FALSE;
> > + return __connman_network_get_connecting(service->network);
> > case CONNMAN_SERVICE_STATE_FAILURE:
> > case CONNMAN_SERVICE_STATE_DISCONNECT:
> > case CONNMAN_SERVICE_STATE_READY:
> >
> We sill have a window, in __connman_network_connect
> __connman_device_disconnect(network->device);
>
> network->connecting = TRUE;
> calling __connman_device_disconnect might result in sending
> CONNMAN_SERVICE_STATE_IDLE which might call auto_connect
> before we set network->connecting.
That's right.
> we can maybe move
> network->connecting = TRUE; before
> __connman_device_disconnect(network->device); but then
> we might endup trying to disconnect this network which wrong.
That actually shouldn't happen, since connman_device_disconnect() skips the
connecting networks. So moving network->connecting = TRUE before
__connman_device_disconnect(network->device) sounds like a solution to me.
> > > Also in __connman_service_auto_connect function we not want
> > > to start connecting if another service is connected or in process,
> > > since service_list does not sort connecting services we can
> > > start connection while another service is already connecting.
> > That's a perfectly valid issue, yes.
> > However I think this needs to be fixed by actually sorting the services
> > properly, i.e. by putting the connecting services right after the
> > READY/ONLINE
> > ones. Could you please come up with a separate patch for that ?
> I can do that if it is ok, I thought sorting was done this way for
> reason but if not I can sort connecting services, let me know if I can
> do that.
It would make sense to move the connecting services right after the
READY/ONLINE ones. If it fails to connect, then they should get their original
order back (i.e. after the favorite ones if they were not favorites). Please
give it a go, I think it's worth it.
Cheers,
Samuel.
--
Intel Open Source Technology Centre
http://oss.intel.com/
_______________________________________________
connman mailing list
[email protected]
http://lists.connman.net/listinfo/connman