[evolution-rss] Bug 612621 - Can't update feeds requiring authentication



commit 875266913de445e760faf9a45b63b9149de4ab7b
Author: Lucian Langa <lucilanga gnome org>
Date:   Sat May 22 11:38:56 2010 +0300

    Bug 612621 - Can't update feeds requiring authentication

 src/network-soup.c |   21 ++++++++++++++++++---
 1 files changed, 18 insertions(+), 3 deletions(-)
---
diff --git a/src/network-soup.c b/src/network-soup.c
index fd7a887..1a759d4 100644
--- a/src/network-soup.c
+++ b/src/network-soup.c
@@ -319,9 +319,9 @@ read_up(gpointer data)
 	feed_dir = rss_component_peek_base_directory();
 	if (!g_file_test(feed_dir, G_FILE_TEST_EXISTS))
 		g_mkdir_with_parents (feed_dir, 0755);
-	feed_name = g_strdup_printf(
-			"%s" G_DIR_SEPARATOR_S "%s", feed_dir, buf);
+	feed_name = g_build_path(G_DIR_SEPARATOR_S, feed_dir, buf, NULL);
 	g_free(feed_dir);
+	d("reading auth info:%s\n", feed_name);
 
 	fr = fopen(feed_name, "r");
 	if (fr) {
@@ -421,6 +421,7 @@ authenticate (SoupSession *session,
 
 	user = g_hash_table_lookup(rf->hruser, data);
 	pass = g_hash_table_lookup(rf->hrpass, data);
+	d("data:%s, user:%s, pass:%s\n", data, user, pass);
 
 	if (user && pass) {
 #if LIBSOUP_VERSION < 2003000
@@ -435,10 +436,23 @@ authenticate (SoupSession *session,
 	}
 #endif
 	} else {
+		read_up(data);
+		user = g_hash_table_lookup(rf->hruser, data);
+		pass = g_hash_table_lookup(rf->hrpass, data);
+		if (user && pass) {
+#if LIBSOUP_VERSION < 2003000
+			*username = g_strdup(user);
+			*password = g_strdup(pass);
+#else
+			if (!retrying)
+				soup_auth_authenticate (auth, user, pass);
+			return;
+#endif
+		}
 		//we test for autofetching in progresss because it seems
 		//preety annoying to pop the authentication popup in front
 		//of the user every time feeds are automatically fetched
-		if (!read_up(data) && !rf->autoupdate) {
+		if (!rf->autoupdate) {
 			//we will continue after user has made a decision on
 			//web auth dialog
 			//Bug 522147 â?? need to be able to pause synchronous I/O
@@ -451,6 +465,7 @@ authpop:		if (G_OBJECT_TYPE(session) == SOUP_TYPE_SESSION_ASYNC) {
 			auth_info->session = session;
 			auth_info->message = msg;
 			web_auth_dialog(auth_info);
+			return;
 		}
 	}
 }



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