Changeset 6b580b0 for perl


Ignore:
Timestamp:
Feb 18, 2008, 5:38:32 PM (17 years ago)
Author:
Alejandro R. Sedeño <asedeno@mit.edu>
Branches:
master, barnowl_perlaim, debian, release-1.10, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
Children:
61abb18
Parents:
18a54ee
Message:
functions.c:
 * removing the redisplay call from owl_function_lastmsg_noredisplay()

select.c:
 * Watch AIM sockets for writing as well. This speeds up AIM connections significantly.

Jabber.pm 
 * keep a copy of the fd around for later.
 * Process() on mainloop for keep-alives

Jabber/ConnectionManager.pm
 * Use the stored fd to drop the dispatch for a connection.

Jabber/Connection.pm
 * Use the GetSock() abstraction since we have it.
 * Call the right do_logout when we have trouble.
Location:
perl/modules/Jabber/lib/BarnOwl/Module
Files:
3 edited

Legend:

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

    r9c7a701 r6b580b0  
    116116            BarnOwl::error("Connection for $jid undefined -- error in reload?");
    117117        }
     118        # We keep this in the mainloop hook for keep-alives
     119        my $status = $client->Process(0);
     120        if ( !defined($status) ) {
     121            BarnOwl::error("Jabber account $jid disconnected!");
     122            do_logout($jid);
     123        }
    118124        if ($::shutdown) {
    119125            do_logout($jid);
    120126            next;
    121127        }
     128
    122129        if ($vars{status_changed}) {
    123130            my $p = new Net::Jabber::Presence;
     
    383390                # The remove_dispatch() method is called from the
    384391                # ConnectionManager's removeConnection() method.
    385                 BarnOwl::add_dispatch($client->getSocket()->fileno(), sub { $client->OwlProcess() });
     392                $client->{fileno} = $client->getSocket()->fileno();
     393                #queue_admin_msg("Connected to jabber as $fullJid ($client->{fileno})");
     394                BarnOwl::add_dispatch($client->{fileno}, sub { $client->OwlProcess() });
    386395            }
    387396        }
  • perl/modules/Jabber/lib/BarnOwl/Module/Jabber/Connection.pm

    r9c7a701 r6b580b0  
    130130    my $self = shift;
    131131    my $sid = getStreamID($self);
    132     return $self->{STREAM}->{SIDS}->{$sid}->{sock} || -1;
     132    return $self->{STREAM}->GetSock($sid) || -1;
    133133}
    134134
     
    145145        my $jid = $self->{SESSION}->{FULLJID};
    146146        BarnOwl::error("Jabber account $jid disconnected!");
    147         do_logout($jid);
     147        BarnOwl::Module::Jabber::do_logout($jid);
    148148    }
    149149}
  • perl/modules/Jabber/lib/BarnOwl/Module/Jabber/ConnectionManager.pm

    r9c7a701 r6b580b0  
    3737    return 0 unless exists $self->{$jidStr};
    3838
    39     BarnOwl::remove_dispatch($self->{$jidStr}->{Client}->getSocket()->fileno());
     39    BarnOwl::remove_dispatch($self->{$jidStr}->{Client}->{fileno}) if $self->{$jidStr}->{Client}->{fileno};
    4040    $self->{$jidStr}->{Client}->Disconnect()
    4141      if $self->{$jidStr}->{Client};
Note: See TracChangeset for help on using the changeset viewer.