diff options
author | Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com> | 2012-05-03 15:15:57 +0300 |
---|---|---|
committer | Patrik Flykt <patrik.flykt@linux.intel.com> | 2012-05-04 11:09:42 +0300 |
commit | 0e3a21069677342e6096441c78f2b6b2ab368a16 (patch) | |
tree | 9dc7cd93841ff037e60b9b000f6f19447d7ec7b4 | |
parent | 81bd485cabb6068839f33411b59e17726ee16121 (diff) | |
download | connman-0e3a21069677342e6096441c78f2b6b2ab368a16.tar.gz connman-0e3a21069677342e6096441c78f2b6b2ab368a16.tar.bz2 connman-0e3a21069677342e6096441c78f2b6b2ab368a16.zip |
agent: Adding a parameter to give the error name to authentication callback
-rw-r--r-- | src/agent.c | 14 | ||||
-rw-r--r-- | src/connman.h | 2 | ||||
-rw-r--r-- | src/service.c | 2 | ||||
-rw-r--r-- | src/wispr.c | 2 |
4 files changed, 13 insertions, 7 deletions
diff --git a/src/agent.c b/src/agent.c index 511049bd..96d40caa 100644 --- a/src/agent.c +++ b/src/agent.c @@ -96,6 +96,7 @@ static void request_input_passphrase_reply(DBusPendingCall *call, void *user_dat struct request_input_reply *passphrase_reply = user_data; connman_bool_t values_received = FALSE; connman_bool_t wps = FALSE; + const char *error = NULL; char *identity = NULL; char *passphrase = NULL; char *wpspin = NULL; @@ -105,8 +106,10 @@ static void request_input_passphrase_reply(DBusPendingCall *call, void *user_dat DBusMessageIter iter, dict; DBusMessage *reply = dbus_pending_call_steal_reply(call); - if (dbus_message_get_type(reply) == DBUS_MESSAGE_TYPE_ERROR) + if (dbus_message_get_type(reply) == DBUS_MESSAGE_TYPE_ERROR) { + error = dbus_message_get_error_name(reply); goto done; + } values_received = TRUE; @@ -176,7 +179,7 @@ done: passphrase_reply->callback(passphrase_reply->service, values_received, name, name_len, identity, passphrase, - wps, wpspin, + wps, wpspin, error, passphrase_reply->user_data); connman_service_unref(passphrase_reply->service); dbus_message_unref(reply); @@ -311,14 +314,17 @@ static void request_input_append_password(DBusMessageIter *iter, static void request_input_login_reply(DBusPendingCall *call, void *user_data) { struct request_input_reply *username_password_reply = user_data; + const char *error = NULL; char *username = NULL; char *password = NULL; char *key; DBusMessageIter iter, dict; DBusMessage *reply = dbus_pending_call_steal_reply(call); - if (dbus_message_get_type(reply) == DBUS_MESSAGE_TYPE_ERROR) + if (dbus_message_get_type(reply) == DBUS_MESSAGE_TYPE_ERROR) { + error = dbus_message_get_error_name(reply); goto done; + } dbus_message_iter_init(reply, &iter); dbus_message_iter_recurse(&iter, &dict); @@ -355,7 +361,7 @@ done: username_password_reply->callback(username_password_reply->service, TRUE, NULL, 0, username, password, - FALSE, NULL, + FALSE, NULL, error, username_password_reply->user_data); connman_service_unref(username_password_reply->service); dbus_message_unref(reply); diff --git a/src/connman.h b/src/connman.h index 550107ca..2e8cfee8 100644 --- a/src/connman.h +++ b/src/connman.h @@ -91,7 +91,7 @@ typedef void (* authentication_cb_t) (struct connman_service *service, const char *name, int name_len, const char *identifier, const char *secret, gboolean wps, const char *wpspin, - void *user_data); + const char *error, void *user_data); typedef void (* browser_authentication_cb_t) (struct connman_service *service, connman_bool_t authentication_done, void *user_data); diff --git a/src/service.c b/src/service.c index 018f12fc..97a42638 100644 --- a/src/service.c +++ b/src/service.c @@ -4402,7 +4402,7 @@ static void request_input_cb (struct connman_service *service, const char *name, int name_len, const char *identity, const char *passphrase, gboolean wps, const char *wpspin, - void *user_data) + const char *error, void *user_data) { struct connman_device *device; int err = 0; diff --git a/src/wispr.c b/src/wispr.c index b56a6490..96bdeb1c 100644 --- a/src/wispr.c +++ b/src/wispr.c @@ -525,7 +525,7 @@ static void wispr_portal_request_wispr_login(struct connman_service *service, const char *ssid, int ssid_len, const char *username, const char *password, gboolean wps, const char *wpspin, - void *user_data) + const char *error, void *user_data) { struct connman_wispr_portal_context *wp_context = user_data; |