[Commits] [SCM] claws branch, master, updated. 3.16.0-25-g6f04970

ticho at claws-mail.org ticho at claws-mail.org
Wed Jan 31 19:57:42 CET 2018


The branch, master has been updated
       via  6f04970280311f128df2098cd949ab5adb77dae4 (commit)
      from  93eaaa941d8914bfc95d0b77da0f698dc719bcbd (commit)

Summary of changes:
 src/plugins/rssyl/libfeed/feed.c      |    2 --
 src/plugins/rssyl/rssyl_update_feed.c |   12 +++++++++++-
 2 files changed, 11 insertions(+), 3 deletions(-)


- Log -----------------------------------------------------------------
commit 6f04970280311f128df2098cd949ab5adb77dae4
Author: Andrej Kacian <ticho at claws-mail.org>
Date:   Wed Jan 31 19:57:07 2018 +0100

    RSSyl: Handle 404 and other fetch failures better.

diff --git a/src/plugins/rssyl/libfeed/feed.c b/src/plugins/rssyl/libfeed/feed.c
index c88f87b..ceb14bf 100644
--- a/src/plugins/rssyl/libfeed/feed.c
+++ b/src/plugins/rssyl/libfeed/feed.c
@@ -340,8 +340,6 @@ guint feed_update(Feed *feed, time_t last_update)
 	if( res != CURLE_OK ) {
 		feed->fetcherr = g_strdup(curl_easy_strerror(res));
 		response_code = FEED_ERR_FETCH;
-	} else if (!feed->is_valid) {
-		response_code = FEED_ERR_NOFEED;
 	} else {
 		curl_easy_getinfo(eh, CURLINFO_RESPONSE_CODE, &response_code);
 	}
diff --git a/src/plugins/rssyl/rssyl_update_feed.c b/src/plugins/rssyl/rssyl_update_feed.c
index 6ecfeb3..d85288d 100644
--- a/src/plugins/rssyl/rssyl_update_feed.c
+++ b/src/plugins/rssyl/rssyl_update_feed.c
@@ -90,6 +90,8 @@ void rssyl_fetch_feed(RFetchCtx *ctx, RSSylVerboseFlags verbose)
 	rssyl_fetch_feed_thr(ctx);
 #endif
 
+	debug_print("RSSyl: got response_code %d\n", ctx->response_code);
+
 	if( ctx->response_code == FEED_ERR_INIT ) {
 		debug_print("RSSyl: libfeed reports init error from libcurl\n");
 		ctx->error = g_strdup("Internal error");
@@ -249,6 +251,14 @@ gboolean rssyl_update_feed(RFolderItem *ritem, RSSylVerboseFlags verbose)
 	debug_print("RSSyl: fetch done; success == %s\n",
 			ctx->success ? "TRUE" : "FALSE");
 
+	if (!ctx->success) {
+		feed_free(ctx->feed);
+		g_free(ctx->error);
+		g_free(ctx);
+		STATUSBAR_POP(mainwin);
+		return ctx->success;
+	}
+
 	debug_print("RSSyl: STARTING TO PARSE FEED\n");
   if( ctx->success && !(ctx->success = rssyl_parse_feed(ritem, ctx->feed)) ) {
 		/* both libcurl and libfeed were happy, but we weren't */
@@ -273,7 +283,7 @@ gboolean rssyl_update_feed(RFolderItem *ritem, RSSylVerboseFlags verbose)
 		feed_free(ctx->feed);
 		g_free(ctx->error);
 		g_free(ctx);
-		return success;
+		return FALSE;
 	}
 
 	if( ritem->fetch_comments )

-----------------------------------------------------------------------


hooks/post-receive
-- 
Claws Mail


More information about the Commits mailing list