Hi Daniel,
It looks better to me now, as we don't touch service.c anymore.
A couple comments though:
On Wed, Aug 10, 2011 at 12:02:00PM +0200, Daniel Wagner wrote:
> @@ -475,6 +492,36 @@ void __connman_notifier_service_state_changed(struct
> connman_service *service,
> if (notifier->service_state_changed)
> notifier->service_state_changed(service, state);
> }
> +
> + old_size = g_hash_table_size(service_hash);
> + found = g_hash_table_lookup(service_hash, service) != NULL;
> +
> + switch (state) {
> + case CONNMAN_SERVICE_STATE_UNKNOWN:
> + case CONNMAN_SERVICE_STATE_DISCONNECT:
> + case CONNMAN_SERVICE_STATE_IDLE:
> + if (found == FALSE)
> + break;
> +
> + g_hash_table_remove(service_hash, service);
> + if (old_size == 1)
> + notify_idle_state(TRUE);
> +
> + break;
> + case CONNMAN_SERVICE_STATE_ASSOCIATION:
> + case CONNMAN_SERVICE_STATE_CONFIGURATION:
> + case CONNMAN_SERVICE_STATE_READY:
> + case CONNMAN_SERVICE_STATE_ONLINE:
> + case CONNMAN_SERVICE_STATE_FAILURE:
> + if (found == TRUE)
> + break;
> +
> + g_hash_table_replace(service_hash, service, service);
You should just call g_hash_table_insert() here, and make the 2 cases
symetrical.
Also I suppose we will get a service state change notification before the
service is removed, so no need to check if your service is still in
service_hash from __connman_notifier_service_remove().
Cheers,
Samuel.
--
Intel Open Source Technology Centre
http://oss.intel.com/
_______________________________________________
connman mailing list
[email protected]
http://lists.connman.net/listinfo/connman