summaryrefslogtreecommitdiff
path: root/tools/wispr.c
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2010-11-21 20:43:03 +0100
committerMarcel Holtmann <marcel@holtmann.org>2010-11-21 20:43:03 +0100
commit1b719b9e6045b3ff30dd7ba4518d9d358a10e479 (patch)
tree1122c21e78e97c21447428876be4686bcffbeaeb /tools/wispr.c
parentd4375251801eb58f26c4308ac250e572824e8330 (diff)
downloadconnman-1b719b9e6045b3ff30dd7ba4518d9d358a10e479.tar.gz
connman-1b719b9e6045b3ff30dd7ba4518d9d358a10e479.tar.bz2
connman-1b719b9e6045b3ff30dd7ba4518d9d358a10e479.zip
Run WISPr login procedure outside of GIOChannel callback
Diffstat (limited to 'tools/wispr.c')
-rw-r--r--tools/wispr.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/tools/wispr.c b/tools/wispr.c
index 7193651b..e43208d0 100644
--- a/tools/wispr.c
+++ b/tools/wispr.c
@@ -148,7 +148,7 @@ struct wispr_session {
char *formdata;
};
-static void execute_login(struct wispr_session *wispr);
+static gboolean execute_login(gpointer user_data);
static struct {
const char *str;
@@ -525,7 +525,7 @@ static gboolean wispr_result(GWebResult *result, gpointer user_data)
return FALSE;
}
- execute_login(wispr);
+ g_idle_add(execute_login, wispr);
return FALSE;
} else if (status == 200 && wispr->msg.message_type == 120) {
int code = wispr->msg.response_code;
@@ -539,13 +539,17 @@ done:
return FALSE;
}
-static void execute_login(struct wispr_session *wispr)
+static gboolean execute_login(gpointer user_data)
{
+ struct wispr_session *wispr = user_data;
+
wispr->request = g_web_request_post(wispr->web, wispr->msg.login_url,
"application/x-www-form-urlencoded",
wispr_input, wispr_result, wispr);
wispr_msg_init(&wispr->msg);
+
+ return FALSE;
}
static gboolean option_debug = FALSE;