commit 1ef8f26a12682f5db21460379b5c701abde91437
parent 8eaa4adaf26da00b54d079514425412215677c73
Author: citbl <citbl@citbl.org>
Date: Mon, 27 Oct 2025 23:11:02 +1000
make timeout configurable
Diffstat:
2 files changed, 13 insertions(+), 10 deletions(-)
diff --git a/src/config.h b/src/config.h
@@ -2,7 +2,10 @@
#define VERSION "v1.4"
-#define USER_AGENT "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36"
+#define USER_AGENT \
+ "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 " \
+ "Safari/537.36"
+#define TIMEOUT 15
// source file for RSS URLS, one per line
// folder and file must exist
diff --git a/src/feeds.c b/src/feeds.c
@@ -49,15 +49,15 @@ fetch_feed(feed_t* feed, char* url)
static mrss_t* rss = NULL;
mrss_options_t* opt;
- opt = mrss_options_new(10, // timeout
- NULL, // proxy
- NULL, // proxy_auth
- NULL, // certfile
- NULL, // password
- NULL, // cacert
- 1, // verifypeer
- NULL, // authentication
- USER_AGENT // for reddit etc. using Chrome
+ opt = mrss_options_new(TIMEOUT, // timeout
+ NULL, // proxy
+ NULL, // proxy_auth
+ NULL, // certfile
+ NULL, // password
+ NULL, // cacert
+ 1, // verifypeer
+ NULL, // authentication
+ USER_AGENT // for reddit etc. using Chrome
);
*feed = (feed_t) { .url = url };