From ce8498aa9741c1dba5661eb75d2a4060fb2101f8 Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Sun, 4 Jan 2009 02:38:03 +0000 Subject: [PATCH] * libcurl operations now timeout after 180 seconds instead of hanging the calling thread forever. --- citadel/modules/openid/serv_openid_rp.c | 2 ++ citadel/modules/rssclient/serv_rssclient.c | 1 + 2 files changed, 3 insertions(+) diff --git a/citadel/modules/openid/serv_openid_rp.c b/citadel/modules/openid/serv_openid_rp.c index c911bda9b..7b6329211 100644 --- a/citadel/modules/openid/serv_openid_rp.c +++ b/citadel/modules/openid/serv_openid_rp.c @@ -541,6 +541,7 @@ int fetch_http(char *url, char *target_buf, int maxbytes, int normalize_len) curl_easy_setopt(curl, CURLOPT_ERRORBUFFER, errmsg); curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1); curl_easy_setopt(curl, CURLOPT_USERAGENT, CITADEL); + curl_easy_setopt(curl, CURLOPT_TIMEOUT, 180); /* die after 180 seconds */ if (!IsEmptyStr(config.c_ip_addr)) { curl_easy_setopt(curl, CURLOPT_INTERFACE, config.c_ip_addr); } @@ -756,6 +757,7 @@ void cmd_oidf(char *argbuf) { curl_easy_setopt(curl, CURLOPT_ERRORBUFFER, errmsg); curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1); curl_easy_setopt(curl, CURLOPT_USERAGENT, CITADEL); + curl_easy_setopt(curl, CURLOPT_TIMEOUT, 180); /* die after 180 seconds */ if (!IsEmptyStr(config.c_ip_addr)) { curl_easy_setopt(curl, CURLOPT_INTERFACE, config.c_ip_addr); } diff --git a/citadel/modules/rssclient/serv_rssclient.c b/citadel/modules/rssclient/serv_rssclient.c index ef85d2cdf..3877cf9ed 100644 --- a/citadel/modules/rssclient/serv_rssclient.c +++ b/citadel/modules/rssclient/serv_rssclient.c @@ -400,6 +400,7 @@ void rss_do_fetching(char *url, char *rooms) { curl_easy_setopt(curl, CURLOPT_ERRORBUFFER, errmsg); curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1); curl_easy_setopt(curl, CURLOPT_USERAGENT, CITADEL); + curl_easy_setopt(curl, CURLOPT_TIMEOUT, 180); /* die after 180 seconds */ if (!IsEmptyStr(config.c_ip_addr)) { curl_easy_setopt(curl, CURLOPT_INTERFACE, config.c_ip_addr); } -- 2.30.2