[evolution-rss] reject fetching feeds with empty url



commit c7c360bdd6e0f8a3e29d1f433e0168cee8747919
Author: Lucian Langa <lucilanga gnome org>
Date:   Tue Oct 27 23:00:36 2009 +0200

    reject fetching feeds with empty url

 src/network-soup.c |    9 +++++----
 src/parser.c       |    2 +-
 src/rss.c          |   11 +++++++----
 3 files changed, 13 insertions(+), 9 deletions(-)
---
diff --git a/src/network-soup.c b/src/network-soup.c
index db53dd6..c29d8c8 100644
--- a/src/network-soup.c
+++ b/src/network-soup.c
@@ -541,9 +541,10 @@ net_get_unblocking(gchar *url,
 {
 	SoupMessage *msg;
 	CallbackInfo *info = NULL;
+	SoupSession *soup_sess;
 	gchar *agstr;
 
-	SoupSession *soup_sess =
+	soup_sess =
 //		soup_session_async_new_with_options(SOUP_SESSION_TIMEOUT, SS_TIMEOUT, NULL);
 		soup_session_async_new();
 
@@ -697,7 +698,7 @@ net_post_blocking(gchar *url, GSList *headers, GString *post,
 		soup_session_abort(soup_sess);
 		g_object_unref(soup_sess);
 		rf->b_session = NULL;
-		g_set_error(err, NET_ERROR, NET_ERROR_GENERIC, "%s", 
+		g_set_error(err, NET_ERROR, NET_ERROR_GENERIC, "%s",
 				soup_status_get_phrase(req->status_code));
 		goto out;
 	}
@@ -711,7 +712,7 @@ net_post_blocking(gchar *url, GSList *headers, GString *post,
 out:
 	if (suri) soup_uri_free(suri);
 	if (req) g_object_unref(G_OBJECT(req));
-	
+
 	return response;
 }
 
@@ -776,7 +777,7 @@ sync_gecko_cookies(void)
 
 	cookie_file = g_file_new_for_path (cookie_path);
 	moz_cookie_file = g_file_new_for_path (moz_cookie_path);
-	g_file_copy(cookie_file, moz_cookie_file, 
+	g_file_copy(cookie_file, moz_cookie_file,
 			G_FILE_COPY_OVERWRITE,
 			NULL, NULL, NULL, NULL);
 	g_free(cookie_path);
diff --git a/src/parser.c b/src/parser.c
index 1783dc7..94c1131 100644
--- a/src/parser.c
+++ b/src/parser.c
@@ -1090,7 +1090,7 @@ update_channel(RDF *r)
 			}
 			farticle++;
 			d(g_print("put success()\n"));
-g_print("subj:%s\n", subj);
+//g_print("subj:%s\n", subj);
 			update_status_icon(chn_name, subj);
 		} else
 			free_cf(CF);
diff --git a/src/rss.c b/src/rss.c
index 5ffb948..a0e2c0e 100644
--- a/src/rss.c
+++ b/src/rss.c
@@ -3405,16 +3405,19 @@ fetch_one_feed(gpointer key, gpointer value, gpointer user_data)
 {
 	GError *err = NULL;
 	gchar *msg;
+	gchar *url = g_hash_table_lookup(rf->hr, lookup_key(key));
 
 	// check if we're enabled and no cancelation signal pending
 	// and no imports pending
-	if (g_hash_table_lookup(rf->hre, lookup_key(key)) && !rf->cancel && !rf->import) {
-		d(g_print("\nFetching: %s..%s\n",
-			(gchar *)g_hash_table_lookup(rf->hr, lookup_key(key)), (gchar *)key));
+	// reject empty urls as we react kinda weird to them
+	if (g_hash_table_lookup(rf->hre, lookup_key(key))
+		&& strlen(url)
+		&& !rf->cancel && !rf->import) {
+		g_print("\nFetching: %s..%s\n", url, (gchar *)key);
 		rf->feed_queue++;
 
 		fetch_unblocking(
-				g_hash_table_lookup(rf->hr, lookup_key(key)),
+				url,
 				user_data,
 				key,
 				(gpointer)finish_feed,



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