timeserver: Simplify timeserver IP address checking
[framework/connectivity/connman.git] / src / agent.c
index a9c2a33..581f977 100644 (file)
@@ -31,8 +31,6 @@
 
 #include "connman.h"
 
-#define REQUEST_TIMEOUT (120 * 1000)           /* 120 seconds */
-
 static DBusConnection *connection = NULL;
 static guint agent_watch = 0;
 static gchar *agent_path = NULL;
@@ -459,7 +457,8 @@ int __connman_agent_request_passphrase_input(struct connman_service *service,
        }
 
        if (dbus_connection_send_with_reply(connection, message, &call,
-                                               REQUEST_TIMEOUT) == FALSE) {
+                                       connman_timeout_input_request())
+                       == FALSE) {
                dbus_message_unref(message);
                g_free(passphrase_reply);
                return -ESRCH;
@@ -525,7 +524,8 @@ int __connman_agent_request_login_input(struct connman_service *service,
        }
 
        if (dbus_connection_send_with_reply(connection, message, &call,
-                                               REQUEST_TIMEOUT) == FALSE) {
+                                       connman_timeout_input_request())
+                       == FALSE) {
                dbus_message_unref(message);
                g_free(username_password_reply);
                return -ESRCH;
@@ -546,7 +546,7 @@ int __connman_agent_request_login_input(struct connman_service *service,
 
        dbus_message_unref(message);
 
-       return -EIO;
+       return -EINPROGRESS;
 }
 
 struct request_browser_reply_data {
@@ -613,7 +613,8 @@ int __connman_agent_request_browser(struct connman_service *service,
        }
 
        if (dbus_connection_send_with_reply(connection, message, &call,
-                                               REQUEST_TIMEOUT) == FALSE) {
+                                       connman_timeout_browser_launch())
+                       == FALSE) {
                dbus_message_unref(message);
                g_free(browser_reply_data);
                return -ESRCH;
@@ -634,7 +635,7 @@ int __connman_agent_request_browser(struct connman_service *service,
 
        dbus_message_unref(message);
 
-       return -EIO;
+       return -EINPROGRESS;
 }
 
 struct report_error_data {
@@ -701,7 +702,8 @@ int __connman_agent_report_error(struct connman_service *service,
        }
 
        if (dbus_connection_send_with_reply(connection, message, &call,
-                                               REQUEST_TIMEOUT) == FALSE) {
+                                       connman_timeout_input_request())
+                       == FALSE) {
                dbus_message_unref(message);
                g_free(report_error);
                return -ESRCH;
@@ -720,7 +722,7 @@ int __connman_agent_report_error(struct connman_service *service,
                                report_error, NULL);
        dbus_message_unref(message);
 
-       return -EIO;
+       return -EINPROGRESS;
 }
 
 int __connman_agent_init(void)