summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWonguk Jeong <wonguk.jeong@samsung.com>2014-08-17 15:07:30 +0200
committerWonguk Jeong <wonguk.jeong@samsung.com>2014-08-17 15:07:30 +0200
commit87f305dd9d80266fcf1f446a0f0925ff7be8de8a (patch)
tree5dd6ad3265a6782dace545fd817447e173e36d80
parent6e0f5937962caadc0fc11b289bc4cdd780cf20b7 (diff)
account: more error message for connection error
-rw-r--r--src/bin/account.c48
-rw-r--r--src/bin/private.h23
2 files changed, 71 insertions, 0 deletions
diff --git a/src/bin/account.c b/src/bin/account.c
index 43b15d8..e24e217 100644
--- a/src/bin/account.c
+++ b/src/bin/account.c
@@ -37,6 +37,7 @@ struct _Account_Info
37 Account_Presence_Info presence; 37 Account_Presence_Info presence;
38 Account_Presence_Info presence_auto; 38 Account_Presence_Info presence_auto;
39 Account_Connection_Status conn_status; 39 Account_Connection_Status conn_status;
40 Account_Connection_Status_Reason conn_status_reason;
40 41
41 Ecore_Timer *reconn_timer; 42 Ecore_Timer *reconn_timer;
42 43
@@ -289,6 +290,52 @@ _get_account_connection_status(Account_Info *ai, Eldbus_Message_Iter *var)
289} 290}
290 291
291static void 292static void
293_get_account_connection_status_reason(Account_Info *ai,
294 Eldbus_Message_Iter *var)
295{
296 unsigned int reason;
297
298 if (!eldbus_message_iter_arguments_get(var, "u", &reason)) return;
299
300 ai->conn_status_reason = reason;
301
302 switch (reason)
303 {
304 case ACCOUNT_CONNECTION_REASON_NONE:
305 case ACCOUNT_CONNECTION_REASON_REQUESTED:
306 break;
307 case ACCOUNT_CONNECTION_REASON_NETWORK_ERROR:
308 ERR("Connection Error: Network error\n");
309 break;
310 case ACCOUNT_CONNECTION_REASON_AUTH_ERROR:
311 ERR("Connection Error: Authentication error\n");
312 break;
313 case ACCOUNT_CONNECTION_REASON_ENCRYPTION_ERROR:
314 ERR("Connection Error: Encryption is unavailable\n");
315 break;
316 case ACCOUNT_CONNECTION_REASON_NAME_IN_USE:
317 ERR("Connection Error: Account name is in use\n");
318 break;
319 case ACCOUNT_CONNECTION_REASON_CERT_NOT_PROVIDED:
320 case ACCOUNT_CONNECTION_REASON_CERT_UNTRUSTED:
321 case ACCOUNT_CONNECTION_REASON_CERT_EXPIRED:
322 case ACCOUNT_CONNECTION_REASON_CERT_NOT_ACTIVATED:
323 case ACCOUNT_CONNECTION_REASON_CERT_HOSTNAME_MISMATCH:
324 case ACCOUNT_CONNECTION_REASON_CERT_FINGERPRINT_MISMATCH:
325 case ACCOUNT_CONNECTION_REASON_CERT_SELF_SIGNED:
326 case ACCOUNT_CONNECTION_REASON_CERT_OTHER_ERROR:
327 case ACCOUNT_CONNECTION_REASON_CERT_REVOKED:
328 case ACCOUNT_CONNECTION_REASON_CERT_INSECURE:
329 case ACCOUNT_CONNECTION_REASON_CERT_LIMIT_EXCEEDED:
330 ERR("Connection Error: Cert error\n");
331 break;
332 default:
333 ERR("Connection Error: Unknown error\n");
334 break;
335 }
336}
337
338static void
292_get_account_connection_error(Account_Info *ai, Eldbus_Message_Iter *var) 339_get_account_connection_error(Account_Info *ai, Eldbus_Message_Iter *var)
293{ 340{
294 const char *err = NULL; 341 const char *err = NULL;
@@ -333,6 +380,7 @@ _update_account_info(void *data, const void *key, Eldbus_Message_Iter *var)
333 { "CurrentPresence", _get_account_presence }, 380 { "CurrentPresence", _get_account_presence },
334 { "Connection", _get_account_connection }, 381 { "Connection", _get_account_connection },
335 { "ConnectionStatus", _get_account_connection_status }, 382 { "ConnectionStatus", _get_account_connection_status },
383 { "ConnectionStatusReason", _get_account_connection_status_reason },
336 { "ConnectionError", _get_account_connection_error }, 384 { "ConnectionError", _get_account_connection_error },
337 { "Enabled", _get_account_enabled }, 385 { "Enabled", _get_account_enabled },
338 { "Valid", _get_account_valid }, 386 { "Valid", _get_account_valid },
diff --git a/src/bin/private.h b/src/bin/private.h
index ecdfe86..d82e4f5 100644
--- a/src/bin/private.h
+++ b/src/bin/private.h
@@ -45,4 +45,27 @@ enum _Account_Connection_Status
45 ACCOUNT_CONNECTION_MAX 45 ACCOUNT_CONNECTION_MAX
46}; 46};
47 47
48typedef enum _Account_Connection_Status_Reason Account_Connection_Status_Reason;
49enum _Account_Connection_Status_Reason
50{
51 ACCOUNT_CONNECTION_REASON_NONE = 0,
52 ACCOUNT_CONNECTION_REASON_REQUESTED,
53 ACCOUNT_CONNECTION_REASON_NETWORK_ERROR,
54 ACCOUNT_CONNECTION_REASON_AUTH_ERROR,
55 ACCOUNT_CONNECTION_REASON_ENCRYPTION_ERROR,
56 ACCOUNT_CONNECTION_REASON_NAME_IN_USE,
57 ACCOUNT_CONNECTION_REASON_CERT_NOT_PROVIDED,
58 ACCOUNT_CONNECTION_REASON_CERT_UNTRUSTED,
59 ACCOUNT_CONNECTION_REASON_CERT_EXPIRED,
60 ACCOUNT_CONNECTION_REASON_CERT_NOT_ACTIVATED,
61 ACCOUNT_CONNECTION_REASON_CERT_HOSTNAME_MISMATCH,
62 ACCOUNT_CONNECTION_REASON_CERT_FINGERPRINT_MISMATCH,
63 ACCOUNT_CONNECTION_REASON_CERT_SELF_SIGNED,
64 ACCOUNT_CONNECTION_REASON_CERT_OTHER_ERROR,
65 ACCOUNT_CONNECTION_REASON_CERT_REVOKED,
66 ACCOUNT_CONNECTION_REASON_CERT_INSECURE,
67 ACCOUNT_CONNECTION_REASON_CERT_LIMIT_EXCEEDED,
68 ACCOUNT_CONNECTION_REASON_MAX
69};
70
48#endif /* __PRIVATE_H__ */ 71#endif /* __PRIVATE_H__ */