From 32cca861e8b61d2e291b996206fcfbda9afdcce2 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Mon, 8 Nov 2010 04:53:37 +0900 Subject: Add support for printing result in GWeb test tool --- tools/web-test.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'tools/web-test.c') 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; -- cgit v1.2.3