[BUG] http.connection.timeout and http.socket.timeout resetted to hardcoded value 3000 side effect in index.jsp

Hello,

I’m working in a “slow” env so I’m facing issues with Openfire timeouts.

I’ve changed manually http.connection.timeout and http.socket.timeout to 50000,

but I’ve noticed by log that this value it’s resetted back to 3000.

Looking at source code I’ve noticed in index.jsp a check about rssEnabled:

<% if (rssEnabled) { %>

<% long nowTime = System.currentTimeMillis();

if (lastBlogFeed == null || lastReleaseFeed == null || nowTime - lastRSSFetch > 21600000) {

FeedFetcherCache feedInfoCache = HashMapFeedInfoCache.getInstance();

FeedFetcher feedFetcher = new HttpClientWithTimeoutFeedFetcher(feedInfoCache);

try {

lastBlogFeed = feedFetcher.retrieveFeed(new URL(blogFeedRSS));

lastReleaseFeed = feedFetcher.retrieveFeed(new URL(releaseFeedRSS));

lastRSSFetch = nowTime;

}

catch (Throwable throwable) {

LoggerFactory.getLogger(“index.jsp”).warn(“Failed to fetch RSS feed:”, throwable);

}

}

but in HttpClientWithTimeoutFeedFetcher there’s this hardcoded set:

/**

  • @see com.sun.syndication.fetcher.FeedFetcher#retrieveFeed(java.net.URL)

*/

@Override

public SyndFeed retrieveFeed(URL feedUrl) throws IllegalArgumentException, IOException, FeedException, FetcherException {

if (feedUrl == null) {

throw new IllegalArgumentException(“null is not a valid URL”);

}

// TODO Fix this

//System.setProperty(“org.apache.commons.logging.Log”, “org.apache.commons.logging.impl.SimpleLog”);

HttpClient client = new HttpClient();

HttpConnectionManager conManager = client.getHttpConnectionManager();

conManager.getParams().setParameter(“http.connection.timeout”, 3000);

conManager.getParams().setParameter(“http.socket.timeout”, 3000);

that seems to reset the previous 2 values to 3000, bypassing custom value.

To avoid this reset, I insert as value

rss.enable -> false