Keep Ethernet services around only for one second
authorMarcel Holtmann <marcel@holtmann.org>
Fri, 17 Jul 2009 09:46:58 +0000 (11:46 +0200)
committerMarcel Holtmann <marcel@holtmann.org>
Fri, 17 Jul 2009 09:46:58 +0000 (11:46 +0200)
src/service.c

index d1a99c8..d389107 100644 (file)
@@ -810,17 +810,21 @@ void __connman_service_put(struct connman_service *service)
 
                iter = g_hash_table_lookup(service_hash, service->identifier);
                if (iter != NULL) {
+                       guint interval = 1;
+
                        reply_pending(service, EIO);
 
                        if (service->network != NULL) {
                                connman_network_unref(service->network);
                                service->network = NULL;
+
+                               interval = 5;
                        }
 
                        service->state = CONNMAN_SERVICE_STATE_FAILURE;
                        service->error = CONNMAN_SERVICE_ERROR_OUT_OF_RANGE;
 
-                       service->timeout = g_timeout_add_seconds(5,
+                       service->timeout = g_timeout_add_seconds(interval,
                                                        remove_timeout, iter);
                } else
                        service_free(service);