[evolution-rss] do not install redirect handler on missing CallbackInfo structure



commit 64aea59f0ae106af79ddb3580011e5ce0bba56bd
Author: Lucian Langa <lucilanga gnome org>
Date:   Sun Mar 6 20:21:59 2011 +0200

    do not install redirect handler on missing CallbackInfo structure

 src/network-soup.c |   13 ++++++-------
 1 files changed, 6 insertions(+), 7 deletions(-)
---
diff --git a/src/network-soup.c b/src/network-soup.c
index 506a721..f14e045 100644
--- a/src/network-soup.c
+++ b/src/network-soup.c
@@ -816,12 +816,11 @@ net_get_unblocking(gchar *url,
 	if (info) {
 		g_signal_connect(G_OBJECT(msg), "got_chunk",
 			G_CALLBACK(got_chunk_cb), info);	//FIXME Find a way to free this maybe weak_ref
+		soup_message_set_flags (msg, SOUP_MESSAGE_NO_REDIRECT);
+		soup_message_add_header_handler (msg, "got_body",
+			"Location", G_CALLBACK (redirect_handler), info);
 	}
 
-	soup_message_set_flags (msg, SOUP_MESSAGE_NO_REDIRECT);
-	soup_message_add_header_handler (msg, "got_body",
-		"Location", G_CALLBACK (redirect_handler), info);
-
 	stnet = g_new0(STNET, 1);
 	stnet->ss = soup_sess;
 	stnet->sm = msg;
@@ -918,11 +917,11 @@ download_unblocking(
 	if (info) {
 		g_signal_connect(G_OBJECT(msg), "got_chunk",
 			G_CALLBACK(got_chunk_cb), info);	//FIXME Find a way to free this maybe weak_ref
+		soup_message_set_flags (msg, SOUP_MESSAGE_NO_REDIRECT);
+		soup_message_add_header_handler (msg, "got_body",
+			"Location", G_CALLBACK (redirect_handler), info);
 	}
 
-	soup_message_set_flags (msg, SOUP_MESSAGE_NO_REDIRECT);
-	soup_message_add_header_handler (msg, "got_body",
-		"Location", G_CALLBACK (redirect_handler), info);
 	soup_message_body_set_accumulate (msg->response_body, FALSE);
 	stnet = g_new0(STNET, 1);
 	stnet->ss = soup_sess;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]