From 38156cef9ee7dd8f704919468028202373c40e72 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sun, 31 Oct 2010 01:03:37 +0200 Subject: [PATCH] Reset GWebResult buffer and length in case of an error --- gweb/gweb.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gweb/gweb.c b/gweb/gweb.c index bfeecc8..bdf90da 100644 --- a/gweb/gweb.c +++ b/gweb/gweb.c @@ -316,6 +316,8 @@ static gboolean received_data(GIOChannel *channel, GIOCondition cond, if (cond & (G_IO_NVAL | G_IO_ERR | G_IO_HUP)) { session->transport_watch = 0; + session->result.buffer = NULL; + session->result.length = 0; call_result_func(session, 400); return FALSE; } @@ -327,6 +329,8 @@ static gboolean received_data(GIOChannel *channel, GIOCondition cond, if (status != G_IO_STATUS_NORMAL) { session->transport_watch = 0; + session->result.buffer = NULL; + session->result.length = 0; call_result_func(session, 200); return FALSE; } -- 2.7.4