Fix missing disarming of the connection timeout
authorMarcel Holtmann <marcel@holtmann.org>
Sat, 18 Jul 2009 01:19:51 +0000 (03:19 +0200)
committerMarcel Holtmann <marcel@holtmann.org>
Sat, 18 Jul 2009 01:19:51 +0000 (03:19 +0200)
src/service.c

index b389b1c..30ce1eb 100644 (file)
@@ -626,9 +626,6 @@ static DBusMessage *disconnect_service(DBusConnection *conn,
 
        DBG("service %p", service);
 
-       if (service->pending != NULL)
-               reply_pending(service, ECONNABORTED);
-
        service->ignore = TRUE;
 
        err = __connman_service_disconnect(service);
@@ -754,10 +751,10 @@ static void service_free(gpointer user_data)
 
        DBG("service %p", service);
 
-       g_hash_table_remove(service_hash, service->identifier);
-
        reply_pending(service, ENOENT);
 
+       g_hash_table_remove(service_hash, service->identifier);
+
        service->path = NULL;
 
        if (path != NULL) {
@@ -795,8 +792,6 @@ void __connman_service_put(struct connman_service *service)
 
                iter = g_hash_table_lookup(service_hash, service->identifier);
                if (iter != NULL) {
-                       reply_pending(service, ENOENT);
-
                        __connman_service_disconnect(service);
 
                        service->state = CONNMAN_SERVICE_STATE_FAILURE;
@@ -1108,6 +1103,8 @@ int __connman_service_disconnect(struct connman_service *service)
 
        DBG("service %p", service);
 
+       reply_pending(service, ECONNABORTED);
+
        if (service->network != NULL) {
                err = __connman_network_disconnect(service->network);
        } else if (service->device != NULL) {