Hi Patrik,
On 01/09/2014 02:14 PM, Patrik Flykt wrote:
>
> Hi,
>
> On Fri, 2013-12-13 at 09:34 +0100, Daniel Wagner wrote:
>>
>> -static int active_sessions[MAX_CONNMAN_SERVICE_TYPES] = {};
>> -static int active_count = 0;
>> -
>> -void __connman_service_set_active_session(bool enable, GSList *list)
>> -{
>> - if (!list)
>> - return;
>> -
>> - if (enable)
>> - active_count++;
>> - else
>> - active_count--;
>
> When active_count > 0 at least one session has issued a connect() in the
> current code.
>
>> - if (!active_count)
>> + if (!__connman_session_running())
>
> These two don't seem to be the same thing...
Good catch. This is not the same. This should be
__connman_session_active_sessions() instead.
>
>> +bool __connman_session_running(void)
>> +{
>> + return g_hash_table_size(session_hash) > 0;
>> +}
>
> ...as connman_session_running() returns true if there are any sessions
> in session_hash regardless of their state, no?
You are right. It is not the same.
cheers,
daniel
_______________________________________________
connman mailing list
[email protected]
https://lists.connman.net/mailman/listinfo/connman