summaryrefslogtreecommitdiff
path: root/src/manager.c
diff options
context:
space:
mode:
authorForest Bond <forest@alittletooquiet.net>2010-05-11 20:56:06 -0400
committerMarcel Holtmann <marcel@holtmann.org>2010-05-12 03:09:31 +0200
commit3e6995b377ef331e8e15267f6be357e7a958203a (patch)
treea2cf749ddc6863cb04300b11c6b1a9e81afbe569 /src/manager.c
parentb2965652f2bd6adb29296e7fa7cda0c5ac6dca89 (diff)
downloadconnman-3e6995b377ef331e8e15267f6be357e7a958203a.tar.gz
connman-3e6995b377ef331e8e15267f6be357e7a958203a.tar.bz2
connman-3e6995b377ef331e8e15267f6be357e7a958203a.zip
Fail immediately enabling/disabling unregistered technology
Previously, calling EnableTechnology or DisableTechnology with an unregistered technology type caused the call to fail silently and eventually timeout. With this patch, a "Not Registered" error is returned immediately instead.
Diffstat (limited to 'src/manager.c')
-rw-r--r--src/manager.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/manager.c b/src/manager.c
index da0ee53d..6561a78c 100644
--- a/src/manager.c
+++ b/src/manager.c
@@ -345,6 +345,9 @@ static DBusMessage *enable_technology(DBusConnection *conn,
else
return __connman_error_invalid_arguments(msg);
+ if (__connman_notifier_is_registered(type) == FALSE)
+ return __connman_error_not_registered(msg);
+
if (__connman_notifier_is_enabled(type) == TRUE)
return __connman_error_already_enabled(msg);
@@ -390,6 +393,9 @@ static DBusMessage *disable_technology(DBusConnection *conn,
else
return __connman_error_invalid_arguments(msg);
+ if (__connman_notifier_is_registered(type) == FALSE)
+ return __connman_error_not_registered(msg);
+
if (__connman_notifier_is_enabled(type) == FALSE)
return __connman_error_already_disabled(msg);