Ignore:
Timestamp:
Jan 12, 2013, 1:43:13 PM (11 years ago)
Author:
Jason Gross <jgross@mit.edu>
Children:
e3a0d71, 4485285
Parents:
4626016
git-author:
Jason Gross <jgross@mit.edu> (01/12/13 13:13:18)
git-committer:
Jason Gross <jgross@mit.edu> (01/12/13 13:43:13)
Message:
Remove trailing whitespace

This commit was made with the command sequence

    for i in $(git ls-files | tr '\n' ' ');
    do
      echo $i; sed -i s'/\s\+$//g' "$(readlink -f $i)";
    done
File:
1 edited

Legend:

Unmodified
Added
Removed
  • perl/modules/Jabber/lib/Net/XMPP/Protocol.pm

    ra8c55b5 r7869e48  
    5858            comes back.  You can optionally specify a timeout so that
    5959            you do not block forever.
    60            
     60
    6161    nonblock - send the packet with an ID, but then return that id and
    6262               control to the master program.  Net::XMPP is still
     
    6969               combined with the XPath function because you can register
    7070               a one shot function tied to the id you get back.
    71                
     71
    7272
    7373=head2 Basic Functions
     
    234234                      groups=>["foo"]
    235235                     );
    236    
     236
    237237    $Con->RosterDBRemove("bob\@jabber.org");
    238238    $Con->RosterDBRemove(Net::XMPP::JID);
     
    244244
    245245    @jids = $Con->RosterDBJIDs();
    246    
     246
    247247    if ($Con->RosterDBGroupExists("foo")) { ...
    248248
    249249    @groups = $Con->RosterDBGroups();
    250    
     250
    251251    @jids = $Con->RosterDBGroupJIDs("foo");
    252    
     252
    253253    @jids = $Con->RosterDBNonGroupJIDs();
    254    
     254
    255255    %hash = $Con->RosterDBQuery("bob\@jabber.org");
    256256    %hash = $Con->RosterDBQuery(Net::XMPP::JID);
     
    340340                              then you must *NOT* specify a callback for
    341341                              presence in the SetCallBacks function.
    342  
     342
    343343                                          Net::XMPP defines a few default
    344344                                          callbacks for various types:
    345  
     345
    346346                                          "subscribe" -
    347347                                            replies with subscribed
    348                                          
     348
    349349                                          "unsubscribe" -
    350350                                            replies with unsubscribed
    351                                          
     351
    352352                                          "subscribed" -
    353353                                            replies with subscribed
    354                                          
     354
    355355                                          "unsubscribed" -
    356356                                            replies with unsubscribed
    357                                          
     357
    358358
    359359    SetMessageCallBacks(type=>function, - sets the callback functions for
     
    441441                           0   - Status ok, no data received.
    442442                         undef - Status not ok, stop processing.
    443                        
     443
    444444                       IMPORTANT: You need to check the output of every
    445445                       Process.  If you get an undef then the connection
     
    684684                            the has returned by RosterParse above, and
    685685                            is the actual hash, not a reference.
    686    
     686
    687687    RosterDBRemove(jid) - Remove a JID from the roster DB. The JID is
    688688                          either a string, or a Net::XMPP::JID object.
     
    696696    RosterDBJIDs() - returns a list of Net::XMPP::JID objects that
    697697                     represents all of the JIDs in the DB.
    698    
     698
    699699    RosterDBGroups() - returns the complete list of roster groups in the
    700700                       roster.
    701    
     701
    702702    RosterDBGroupExists(group) - return 1 if the group is a group in the
    703703                                 roster DB, undef otherwise.
     
    706706                               that represents all of the JIDs in the
    707707                               specified roster group.
    708    
     708
    709709    RosterDBNonGroupJIDs() - returns a list of Net::XMPP::JID objects
    710710                             that represents all of the JIDs not in a
     
    720720                             the given key.  The available keys are:
    721721                               name, ask, subsrcription and groups
    722                              The JID is either a string, or a 
     722                             The JID is either a string, or a
    723723                             Net::XMPP::JID object.
    724724
     
    827827    my $id;
    828828    my $tree;
    829    
     829
    830830    if (ref($object) !~ /^Net::XMPP/)
    831831    {
     
    884884                }
    885885            }
    886            
     886
    887887            return if $direct_pass;
    888888        }
     
    10931093###############################################################################
    10941094sub SetXPathCallBacks
    1095 { 
     1095{
    10961096    my $self = shift;
    10971097    my (%xpaths) = @_;
     
    11331133###############################################################################
    11341134sub SetDirectXPathCallBacks
    1135 { 
     1135{
    11361136    my $self = shift;
    11371137    my (%xpaths) = @_;
     
    15381538
    15391539    $self->{DEBUG}->Log4("PresenceDBParse: pres(",$presence->GetXML(),")");
    1540    
     1540
    15411541    my $type = $presence->GetType();
    15421542    $type = "" unless defined($type);
     
    19421942        &{$self->{CB}->{update}}() if exists($self->{CB}->{update});
    19431943    }
    1944    
     1944
    19451945    #-------------------------------------------------------------------------
    19461946    # The loop finished... but was it done?
     
    19511951        return( "system","SASL timed out authenticating");
    19521952    }
    1953    
     1953
    19541954    #-------------------------------------------------------------------------
    19551955    # Ok, it was done... but did we auth?
     
    19601960        return ( "error", $self->{STREAM}->SASLClientError($sid));
    19611961    }
    1962    
     1962
    19631963    #-------------------------------------------------------------------------
    19641964    # Phew... Restart the <stream:stream> per XMPP
     
    19671967    $self->{SESSION} = $self->{STREAM}->OpenStream($sid);
    19681968    $sid = $self->{SESSION}->{id};
    1969    
     1969
    19701970    $self->{DEBUG}->Log1("AuthSASL: We got a new session. sid($sid)");
    19711971
     
    20122012    $iq->SetIQ(type=>"set");
    20132013    my $bind = $iq->NewChild(&ConstXMLNS("xmpp-bind"));
    2014    
     2014
    20152015    if (defined($resource) && ($resource ne ""))
    20162016    {
     
    20372037    $iq->SetIQ(type=>"set");
    20382038    my $session = $iq->NewChild(&ConstXMLNS("xmpp-session"));
    2039    
     2039
    20402040    my $result = $self->SendAndReceiveWithID($iq);
    20412041}
     
    20962096    my %args;
    20972097    while($#_ >= 0) { $args{ lc pop(@_) } = pop(@_); }
    2098    
     2098
    20992099    my $iq = $self->_iq();
    21002100    $iq->SetIQ(type=>"get");
     
    21222122    my %args;
    21232123    while($#_ >= 0) { $args{ lc pop(@_) } = pop(@_); }
    2124    
     2124
    21252125    my $iq = $self->_iq();
    21262126    $iq->SetIQ(type=>"set");
     
    21812181        return $id;
    21822182    }
    2183    
     2183
    21842184    return $self->SendWithID($iq) if ($args{mode} eq "nonblock");
    21852185
     
    24432443        $jid = $jid->GetJID();
    24442444    }
    2445    
     2445
    24462446    return unless exists($self->{ROSTERDB});
    24472447    return unless exists($self->{ROSTERDB}->{JIDS});
     
    26112611        $jid = $jid->GetJID();
    26122612    }
    2613    
     2613
    26142614    return unless $self->RosterDBExists($jid);
    26152615    if (defined($key))
     
    26192619    }
    26202620    return %{$self->{ROSTERDB}->{JIDS}->{$jid}};
    2621 }                       
     2621}
    26222622
    26232623
     
    26452645            }
    26462646        }
    2647    
     2647
    26482648        delete($self->{ROSTERDB}->{JIDS}->{$jid});
    26492649    }
     
    26922692        $self->TLSClientFailure($node);
    26932693    }
    2694    
     2694
    26952695    if ($tag eq "proceed")
    26962696    {
     
    27112711    $timeout = 120 unless defined($timeout);
    27122712    $timeout = 120 if ($timeout eq "");
    2713    
     2713
    27142714    $self->TLSSendStartTLS();
    27152715
     
    27512751        $self->{TLS}->{error} = $message;
    27522752    }
    2753    
     2753
    27542754    $self->RemoveDirectXPathCallBacks('/[@xmlns="'.&ConstXMLNS("xmpp-tls").'"]'=>$TLS_CALLBACK);
    27552755}
     
    27642764{
    27652765    my $self = shift;
    2766    
     2766
    27672767    return $self->{TLS}->{secure};
    27682768}
     
    27772777{
    27782778    my $self = shift;
    2779    
     2779
    27802780    return $self->{TLS}->{done};
    27812781}
     
    27902790{
    27912791    my $self = shift;
    2792    
     2792
    27932793    return $self->{TLS}->{error};
    27942794}
     
    28042804    my $self = shift;
    28052805    my $node = shift;
    2806    
     2806
    28072807    my $type = &XML::Stream::XPath($node,"*/name()");
    28082808
     
    28212821    my $self = shift;
    28222822    my $type = shift;
    2823    
     2823
    28242824    $self->Send("<failure xmlns='".&ConstXMLNS('xmpp-tls')."'><${type}/></failure>");
    28252825}
     
    28802880        $self->SASLAnswerChallenge($node);
    28812881    }
    2882    
     2882
    28832883    if ($tag eq "failure")
    28842884    {
    28852885        $self->SASLClientFailure($node);
    28862886    }
    2887    
     2887
    28882888    if ($tag eq "success")
    28892889    {
     
    29062906    my $challenge64 = &XML::Stream::XPath($node,"text()");
    29072907    my $challenge = MIME::Base64::decode_base64($challenge64);
    2908    
     2908
    29092909    my $response = $self->SASLGetClient()->client_step($challenge);
    29102910
     
    29292929
    29302930    return unless defined($mechanisms);
    2931    
     2931
    29322932    my $sasl = new Authen::SASL(mechanism=>join(" ",@{$mechanisms}),
    29332933                                callback=>{ user => $username,
     
    29542954{
    29552955    my $self = shift;
    2956    
     2956
    29572957    return $self->{SASL}->{authed};
    29582958}
     
    29672967{
    29682968    my $self = shift;
    2969    
     2969
    29702970    return $self->{SASL}->{done};
    29712971}
     
    29802980{
    29812981    my $self = shift;
    2982    
     2982
    29832983    return $self->{SASL}->{error};
    29842984}
     
    29942994    my $self = shift;
    29952995    my $node = shift;
    2996    
     2996
    29972997    my $type = &XML::Stream::XPath($node,"*/name()");
    29982998
     
    30113011    my $self = shift;
    30123012    my $node = shift;
    3013    
     3013
    30143014    $self->{SASL}->{authed} = 1;
    30153015    $self->{SASL}->{done} = 1;
     
    30273027{
    30283028    my $self = shift;
    3029    
     3029
    30303030    return $self->{SASL}->{client};
    30313031}
     
    30683068    my $self = shift;
    30693069    my $type = shift;
    3070    
     3070
    30713071    $self->Send("<failure xmlns='".&ConstXMLNS('xmpp-sasl')."'><${type}/></failure>");
    30723072}
     
    32323232}
    32333233
    3234    
     3234
    32353235##############################################################################
    32363236#
     
    33093309{
    33103310    my $const = shift;
    3311    
     3311
    33123312    return $XMLNS{$const};
    33133313}
Note: See TracChangeset for help on using the changeset viewer.