Ignore:
Timestamp:
Oct 18, 2009, 3:59:29 PM (12 years ago)
Author:
Alex Vandiver <alexmv@mit.edu>
Branches:
master, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
Children:
f3678c3
Parents:
99cc3dc
git-author:
Alex Vandiver <alexmv@mit.edu> (03/22/09 02:06:46)
git-committer:
Alex Vandiver <alexmv@mit.edu> (10/18/09 15:59:29)
Message:
Make Jabber try to reconnect when disconnected, at exponential intervals

Make the ConnectionManager store auth information on connect, and use
that auth information to try to reconnect and re-auth.  Use some
simple exponential backoff, capped at 5 minutes, as intervals for
reconnecting.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • perl/modules/Jabber/lib/BarnOwl/Module/Jabber/Connection.pm

    r5f3168a ra957e92  
    142142sub OwlProcess {
    143143    my $self = shift;
     144    my $jid = shift || $self->{SESSION}->{FULLJID};
    144145    my $status = $self->Process(0);
    145146    if ( !defined($status) ) {
    146         my $jid = $self->{SESSION}->{FULLJID};
    147         BarnOwl::error("Jabber account $jid disconnected!");
    148         BarnOwl::Module::Jabber::do_logout($jid);
     147        $BarnOwl::Module::Jabber::conn->scheduleReconnect($jid);
    149148    }
     149}
     150
     151=head2 Disconnect
     152
     153Work around a bug in Net::Jabber::Client where Process' return status
     154is not cleared on disconnect.
     155
     156=cut
     157
     158sub Disconnect {
     159    my $self = shift;
     160    delete $self->{PROCESSERROR};
     161    return $self->SUPER::Disconnect(@_);
    150162}
    151163
Note: See TracChangeset for help on using the changeset viewer.