On 01/09/2014 02:28 PM, Patrik Flykt wrote:
> If we had a "cause" in the service struct, i.e.
>
> enum service_connect_reason = {
> CONNMAN_SERVICE_CONNECT_AUTO = 1,
> CONNMAN_SERVICE_CONNECT_USER = 2,
> CONNMAN_SERVICE_CONNECT_SESSION = 3,
> };
>
> that would replace service->userconnect, we could disconnect the service
> immediately when the last session stops using it (actually, the bearer)
> if service->connect_reason == CONNMAN_SERVICE_CONNECT_SESSION;
I played around with your idea. Something which isn't obvious is that
service->userconnect is a flag which says the user has pressed
Service.Connect(). That can't be mixed with service->connect_reason.
These two information need to be kept separate. The session code this
via info->connect. In short service->userconnect needs to stay.
daniel
_______________________________________________
connman mailing list
[email protected]
https://lists.connman.net/mailman/listinfo/connman