From 4edf2cd46af41132f0235069bb4c03b09c1a24ca Mon Sep 17 00:00:00 2001 From: Dan Boger Date: Wed, 12 Aug 2009 16:56:34 -0700 Subject: [PATCH 1/1] Add new setting - twitter_timeout, defaults to 30 seconds. Requests that take longer than this timeout should just fail (instead of causing irssi to ping out) --- twirssi.pl | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/twirssi.pl b/twirssi.pl index a52823f..331715c 100644 --- a/twirssi.pl +++ b/twirssi.pl @@ -499,6 +499,15 @@ sub cmd_login { ssl => Irssi::settings_get_bool("twirssi_avoid_ssl") ? 0 : 1, ); + unless ($twit) { + ¬ice("Failed to create Net::$service object! Aborting."); + return; + } + + if ( my $timeout = Irssi::settings_get_int("twitter_timeout") ) { + $twit->ua->timeout($timeout); + } + unless ( $twit->verify_credentials() ) { ¬ice("Login as $user\@$service failed"); $twit = undef; @@ -1511,6 +1520,7 @@ Irssi::settings_add_str( "twirssi", "twirssi_replies_store", ".irssi/scripts/twirssi.json" ); Irssi::settings_add_int( "twirssi", "twitter_friends_poll", 600 ); +Irssi::settings_add_int( "twirssi", "twitter_timeout", 30 ); Irssi::settings_add_bool( "twirssi", "twirssi_upgrade_beta", 0 ); Irssi::settings_add_bool( "twirssi", "tweet_to_away", 0 ); -- 2.39.5