diff options
author | Marcel Holtmann <marcel@holtmann.org> | 2010-11-08 04:53:37 +0900 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2010-11-08 04:53:37 +0900 |
commit | 32cca861e8b61d2e291b996206fcfbda9afdcce2 (patch) | |
tree | 8a2a0c266da2287ec259c3562d799f3f059a37df /tools | |
parent | eeae930c4261cd0de57b09e5ca1de7998f4e9630 (diff) | |
download | connman-32cca861e8b61d2e291b996206fcfbda9afdcce2.tar.gz connman-32cca861e8b61d2e291b996206fcfbda9afdcce2.tar.bz2 connman-32cca861e8b61d2e291b996206fcfbda9afdcce2.zip |
Add support for printing result in GWeb test tool
Diffstat (limited to 'tools')
-rw-r--r-- | tools/web-test.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/tools/web-test.c b/tools/web-test.c index 58ff1317..adfd09df 100644 --- a/tools/web-test.c +++ b/tools/web-test.c @@ -45,17 +45,26 @@ static void sig_term(int sig) static gboolean web_result(GWebResult *result, gpointer user_data) { + const guint8 *chunk; + gsize length; guint16 status; gdouble elapsed; + g_web_result_get_chunk(result, &chunk, &length); + + if (length > 0) { + printf("%s\n", (char *) chunk); + return TRUE; + } + status = g_web_result_get_status(result); + g_print("status: %03u\n", status); + elapsed = g_timer_elapsed(timer, NULL); g_print("elapse: %f seconds\n", elapsed); - g_print("status: %03u\n", status); - g_main_loop_quit(main_loop); return FALSE; |