From 11ec07811cc41e1b244467d25772ef021be9db1b Mon Sep 17 00:00:00 2001 From: Wilmer van der Gaast Date: Sat, 22 Sep 2012 13:44:47 +0100 Subject: Since I can't figure out where the stalls are coming from at this point, at least have a work-around for it. After hitting the Twitter timer a few times while a previous fetch still seems to be running, close the connection. Auto-reconnect will do the rest. --- lib/http_client.c | 2 +- protocols/twitter/twitter_lib.c | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/http_client.c b/lib/http_client.c index 6e7c7b72..7ed539d0 100644 --- a/lib/http_client.c +++ b/lib/http_client.c @@ -72,7 +72,7 @@ struct http_request *http_dorequest( char *host, int port, int ssl, char *reques if( getenv( "BITLBEE_DEBUG" ) ) printf( "About to send HTTP request:\n%s\n", req->request ); - return( req ); + return req; } struct http_request *http_dorequest_url( char *url_string, http_input_function func, gpointer data ) diff --git a/protocols/twitter/twitter_lib.c b/protocols/twitter/twitter_lib.c index 757cb6fe..8e2804a5 100644 --- a/protocols/twitter/twitter_lib.c +++ b/protocols/twitter/twitter_lib.c @@ -734,7 +734,10 @@ void twitter_get_timeline(struct im_connection *ic, gint64 next_cursor) gboolean include_mentions = set_getbool(&ic->acc->set, "fetch_mentions"); if (td->flags & TWITTER_DOING_TIMELINE) { - return; + if (++td->http_fails >= 5) { + imcb_error(ic, "Fetch timeout (%d)", td->flags); + imc_logout(ic, TRUE); + } } td->flags |= TWITTER_DOING_TIMELINE; -- cgit v1.2.3