Re: [PATCH core 02/10] wc: test app
- From: Simón Pena <spenap gmail com>
- To: grilo-list gnome org
- Subject: Re: [PATCH core 02/10] wc: test app
- Date: Tue, 05 Oct 2010 21:10:33 +0200
On 04/10/10 21:11, Víctor Manuel Jáquez Leal wrote:
> Signed-off-by: Víctor Manuel Jáquez Leal <vjaquez igalia com>
> ---
> libs/net/wc-test.c | 80 ++++++++++++++++++++++++++++++++++++++++++++++++++++
> 1 files changed, 80 insertions(+), 0 deletions(-)
> create mode 100644 libs/net/wc-test.c
>
> diff --git a/libs/net/wc-test.c b/libs/net/wc-test.c
> new file mode 100644
> index 0000000..2721bc6
> --- /dev/null
> +++ b/libs/net/wc-test.c
> @@ -0,0 +1,80 @@
> +#include "grl-net-wc.h"
> +#include <stdio.h>
> +
> +GMainLoop *loop;
> +const gchar *uri;
> +
> +static void
> +fetch_result (GObject *source,
> + GAsyncResult *result,
> + gpointer user_data)
> +{
> + gchar *content;
> + gsize length;
> + GError *error = NULL;
> +
> + if (!grl_net_wc_request_finish (GRL_NET_WC (source),
> + result,
> + &content,
> + &length,
> + &error)) {
> + g_print ("Error: %s\n", error->message);
> + goto end_func;
> + }
> +
> + fwrite (content, 1, length, stdout);
This segfaults for me here when fwriting, when invoking the tests
without arguments. Looks like the Yahoo address you're using by default
replies with a 302 (Found [1]), and then content remains NULL.
Passing another URL which doesn't result in a 302 works just fine.
[1] http://tools.ietf.org/html/rfc2616#section-10.3.3
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]