diff options
author | Marcel Holtmann <marcel@holtmann.org> | 2010-10-30 14:58:32 +0200 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2010-10-30 14:58:32 +0200 |
commit | 3f06a3d031f45bc45033f9088ebca9d0a5e9d45a (patch) | |
tree | 7ff7e2a2b88dcf494180724e4f9db98cb979f232 /gweb/gweb.c | |
parent | a95f2716f609c2b1dbf49a11830535d88177dffd (diff) | |
download | connman-3f06a3d031f45bc45033f9088ebca9d0a5e9d45a.tar.gz connman-3f06a3d031f45bc45033f9088ebca9d0a5e9d45a.tar.bz2 connman-3f06a3d031f45bc45033f9088ebca9d0a5e9d45a.zip |
Add basic update for GWeb request API
Diffstat (limited to 'gweb/gweb.c')
-rw-r--r-- | gweb/gweb.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/gweb/gweb.c b/gweb/gweb.c index 39f8ecfb..3a61353f 100644 --- a/gweb/gweb.c +++ b/gweb/gweb.c @@ -35,6 +35,9 @@ #include "gresolv.h" #include "gweb.h" +struct _GWebResult { +}; + struct web_session { GWeb *web; @@ -49,6 +52,8 @@ struct web_session { guint resolv_action; char *request; + GWebResult *result; + GWebResultFunc result_func; gpointer result_data; }; @@ -201,7 +206,7 @@ static gboolean received_data(GIOChannel *channel, GIOCondition cond, if (cond & (G_IO_NVAL | G_IO_ERR | G_IO_HUP)) { session->transport_watch = 0; if (session->result_func != NULL) - session->result_func(400, session->result_data); + session->result_func(400, NULL, session->result_data); return FALSE; } @@ -213,7 +218,7 @@ static gboolean received_data(GIOChannel *channel, GIOCondition cond, if (len == 0) { session->transport_watch = 0; if (session->result_func != NULL) - session->result_func(200, session->result_data); + session->result_func(200, NULL, session->result_data); return FALSE; } printf("%s", buf); @@ -339,7 +344,7 @@ static void resolv_result(GResolvResultStatus status, if (results == NULL || results[0] == NULL) { if (session->result_func != NULL) - session->result_func(404, session->result_data); + session->result_func(404, NULL, session->result_data); return; } @@ -347,7 +352,7 @@ static void resolv_result(GResolvResultStatus status, if (inet_aton(results[0], NULL) == 0) { if (session->result_func != NULL) - session->result_func(400, session->result_data); + session->result_func(400, NULL, session->result_data); return; } @@ -355,7 +360,7 @@ static void resolv_result(GResolvResultStatus status, if (connect_session_transport(session) < 0) { if (session->result_func != NULL) - session->result_func(409, session->result_data); + session->result_func(409, NULL, session->result_data); return; } |