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/XML/Stream.pm

    ra8d5a39 r7869e48  
    317317
    318318        my $lc = lc($module);
    319        
     319
    320320        eval("\$HANDLERS{\$lc}->{startElement} = \\&XML::Stream::${module}::_handle_element;");
    321321        eval("\$HANDLERS{\$lc}->{endElement}   = \\&XML::Stream::${module}::_handle_close;");
     
    600600
    601601    my $root = $self->GetRoot($sid);
    602    
     602
    603603    if ($root->{xmlns} ne $self->{SIDS}->{$serverid}->{namespace})
    604604    {
     
    668668    }
    669669    while($#_ >= 0) { $self->{SIDS}->{newconnection}->{ lc pop(@_) } = pop(@_); }
    670    
     670
    671671    my $timeout = exists($self->{SIDS}->{newconnection}->{timeout}) ?
    672672                  delete($self->{SIDS}->{newconnection}->{timeout}) :
     
    674674
    675675    $self->debug(4,"Connect: timeout($timeout)");
    676    
     676
    677677
    678678    if (exists($self->{SIDS}->{newconnection}->{srv}))
     
    683683            my $res = Net::DNS::Resolver->new();
    684684            my $query = $res->query($self->{SIDS}->{newconnection}->{srv}.".".$self->{SIDS}->{newconnection}->{hostname},"SRV");
    685            
     685
    686686            if ($query)
    687             { 
     687            {
    688688                $self->{SIDS}->{newconnection}->{hostname} = ($query->answer)[0]->target();
    689689                $self->{SIDS}->{newconnection}->{port} = ($query->answer)[0]->port();
     
    771771        $self->{SIDS}->{newconnection}->{sock} =
    772772            new FileHandle(">&STDOUT");
    773     } 
     773    }
    774774
    775775    #---------------------------------------------------------------------------
     
    10301030    #---------------------------------------------------------------------------
    10311031    my %stream_args;
    1032    
     1032
    10331033    if (($self->{SIDS}->{$currsid}->{connectiontype} eq "tcpip") ||
    10341034        ($self->{SIDS}->{$currsid}->{connectiontype} eq "http"))
     
    10361036        $stream_args{to}= $self->{SIDS}->{$currsid}->{hostname}
    10371037            unless exists($self->{SIDS}->{$currsid}->{to});
    1038        
     1038
    10391039        $stream_args{to} = $self->{SIDS}->{$currsid}->{to}
    10401040            if exists($self->{SIDS}->{$currsid}->{to});
     
    10441044                ($self->{SIDS}->{$currsid}->{myhostname} ne "")
    10451045               );
    1046        
     1046
    10471047        $stream_args{from} = $self->{SIDS}->{$currsid}->{from}
    10481048            if exists($self->{SIDS}->{$currsid}->{from});
    1049        
     1049
    10501050        $stream_args{id} = $self->{SIDS}->{$currsid}->{id}
    10511051            if (exists($self->{SIDS}->{$currsid}->{id}) &&
     
    10551055        $stream_args{namespaces} = $self->{SIDS}->{$currsid}->{namespaces};
    10561056    }
    1057    
     1057
    10581058    my $stream =
    10591059        $self->StreamHeader(
     
    11721172        }
    11731173    }
    1174        
     1174
    11751175    return $self->GetRoot($sid);
    11761176}
     
    13331333    #---------------------------------------------------------------------------
    13341334    $self->{SIDS}->{$sid}->{streamfeatures}->{received} = 0;
    1335    
     1335
    13361336    #---------------------------------------------------------------------------
    13371337    # First acitivty is the connection... duh. =)
     
    15221522                $self->debug(4,"Process: sid($sid) time(",time,") timeout(undef)");
    15231523            }
    1524            
     1524
    15251525            $self->Respond($sid)
    15261526                if (exists($self->{SIDS}->{$sid}->{activitytimeout}) &&
     
    16371637    $self->debug(3,"Send: sid($sid)");
    16381638    $self->debug(3,"Send: status($self->{SIDS}->{$sid}->{status})");
    1639    
     1639
    16401640    $self->{SIDS}->{$sid}->{keepalive} = time;
    16411641
     
    16771677                return;
    16781678            }
    1679            
     1679
    16801680            $self->debug(4,"Send: SENDWRITTEN($self->{SENDWRITTEN})");
    16811681
     
    17361736        }
    17371737    }
    1738    
     1738
    17391739    #-------------------------------------------------------------------------
    17401740    # XMPP-TLS - 1.0
     
    17531753        }
    17541754    }
    1755    
     1755
    17561756    #-------------------------------------------------------------------------
    17571757    # XMPP-Bind - 1.0
     
    17621762        $self->{SIDS}->{$sid}->{streamfeatures}->{'xmpp-bind'} = 1;
    17631763    }
    1764    
     1764
    17651765    #-------------------------------------------------------------------------
    17661766    # XMPP-Session - 1.0
     
    17711771        $self->{SIDS}->{$sid}->{streamfeatures}->{'xmpp-session'} = 1;
    17721772    }
    1773    
     1773
    17741774}
    17751775
     
    18331833        $self->TLSClientFailure($sid,$node);
    18341834    }
    1835    
     1835
    18361836    if ($tag eq "proceed")
    18371837    {
     
    18531853    $timeout = 120 unless defined($timeout);
    18541854    $timeout = 120 if ($timeout eq "");
    1855    
     1855
    18561856    $self->TLSStartTLS($sid);
    18571857
     
    19041904        return;
    19051905    }
    1906    
     1906
    19071907    IO::Socket::SSL->start_SSL($self->{SIDS}->{$sid}->{sock},{SSL_verify_mode=>0x00});
    19081908
     
    19101910    $self->debug(1,"TLSClientProceed: SSL: We are secure")
    19111911        if ($self->{SIDS}->{$sid}->{sock});
    1912    
     1912
    19131913    $self->{SIDS}->{$sid}->{tls}->{done} = 1;
    19141914    $self->{SIDS}->{$sid}->{tls}->{secure} = 1;
     
    19251925    my $self = shift;
    19261926    my $sid = shift;
    1927    
     1927
    19281928    return $self->{SIDS}->{$sid}->{tls}->{secure};
    19291929}
     
    19391939    my $self = shift;
    19401940    my $sid = shift;
    1941    
     1941
    19421942    return $self->{SIDS}->{$sid}->{tls}->{done};
    19431943}
     
    19531953    my $self = shift;
    19541954    my $sid = shift;
    1955    
     1955
    19561956    return $self->{SIDS}->{$sid}->{tls}->{error};
    19571957}
     
    19681968    my $sid = shift;
    19691969    my $node = shift;
    1970    
     1970
    19711971    my $type = &XPath($node,"*/name()");
    19721972
     
    19861986    my $sid = shift;
    19871987    my $type = shift;
    1988    
     1988
    19891989    $self->Send($sid,"<failure xmlns='".&ConstXMLNS('xmpp-tls')."'><${type}/></failure>");
    19901990}
     
    20182018        $self->SASLAnswerChallenge($sid,$node);
    20192019    }
    2020    
     2020
    20212021    if ($tag eq "failure")
    20222022    {
    20232023        $self->SASLClientFailure($sid,$node);
    20242024    }
    2025    
     2025
    20262026    if ($tag eq "success")
    20272027    {
     
    20452045    my $challenge64 = &XPath($node,"text()");
    20462046    my $challenge = MIME::Base64::decode_base64($challenge64);
    2047    
     2047
    20482048    #-------------------------------------------------------------------------
    20492049    # As far as I can tell, if the challenge contains rspauth, then we authed.
     
    21122112
    21132113    return unless defined($mechanisms);
    2114    
     2114
    21152115    my $sasl = new Authen::SASL(mechanism=>join(" ",@{$mechanisms}),
    21162116                                callback=>{
     
    21402140    my $self = shift;
    21412141    my $sid = shift;
    2142    
     2142
    21432143    return $self->{SIDS}->{$sid}->{sasl}->{authed};
    21442144}
     
    21542154    my $self = shift;
    21552155    my $sid = shift;
    2156    
     2156
    21572157    return $self->{SIDS}->{$sid}->{sasl}->{done};
    21582158}
     
    21682168    my $self = shift;
    21692169    my $sid = shift;
    2170    
     2170
    21712171    return $self->{SIDS}->{$sid}->{sasl}->{error};
    21722172}
     
    21832183    my $sid = shift;
    21842184    my $node = shift;
    2185    
     2185
    21862186    my $type = &XPath($node,"*/name()");
    21872187
     
    22012201    my $sid = shift;
    22022202    my $node = shift;
    2203    
     2203
    22042204    $self->{SIDS}->{$sid}->{sasl}->{authed} = 1;
    22052205    $self->{SIDS}->{$sid}->{sasl}->{done} = 1;
     
    22172217    my $sid = shift;
    22182218    my $type = shift;
    2219    
     2219
    22202220    $self->Send($sid,"<failure xmlns='".&ConstXMLNS('xmpp-sasl')."'><${type}/></failure>");
    22212221}
     
    22922292        # Make sure we are receiving a valid stream on the same namespace.
    22932293        #---------------------------------------------------------------------
    2294        
     2294
    22952295        $self->debug(3,"_handle_root: ($self->{SIDS}->{$self->{SIDS}->{$sid}->{serverid}}->{namespace})");
    22962296        $self->{SIDS}->{$sid}->{status} =
     
    23282328        }
    23292329    }
    2330    
     2330
    23312331    #-------------------------------------------------------------------------
    23322332    # Sometimes we will get an error, so let's parse the tag assuming that we
     
    23352335    my $stream_prefix = $self->StreamPrefix($sid);
    23362336    $self->debug(5,"_handle_root: stream_prefix($stream_prefix)");
    2337    
     2337
    23382338    if ($tag eq $stream_prefix.":error")
    23392339    {
     
    24412441    $self->{SIDS}->{$sid}->{streamerror}->{type} = "unknown";
    24422442    $self->{SIDS}->{$sid}->{streamerror}->{node} = $node;
    2443    
     2443
    24442444    #-------------------------------------------------------------------------
    24452445    # Check for older 0.9 streams and handle the errors for them.
     
    26762676    my $tree = shift;
    26772677    my $path = shift;
    2678    
     2678
    26792679    my $query = new XML::Stream::XPath::Query($path);
    26802680    my $result = $query->execute($tree);
     
    26832683        my %attribs = $result->getAttribs();
    26842684        return %attribs if (scalar(keys(%attribs)) > 0);
    2685        
     2685
    26862686        my @values = $result->getValues();
    26872687        @values = $result->getList() unless ($#values > -1);
     
    27032703    my $tree = shift;
    27042704    my $path = shift;
    2705    
     2705
    27062706    my $query = new XML::Stream::XPath::Query($path);
    27072707    my $result = $query->execute($tree);
     
    28912891{
    28922892    my $const = shift;
    2893    
     2893
    28942894    return $XMLNS{$const};
    28952895}
     
    29052905    my $self = shift;
    29062906    my $sid = shift;
    2907    
     2907
    29082908    return $self->ns2prefix($sid,&ConstXMLNS("stream"));
    29092909}
     
    29912991
    29922992    $self->debug(1,"LoadSSL: Load the IO::Socket::SSL module");
    2993    
     2993
    29942994    if (defined($SSL) && ($SSL == 1))
    29952995    {
     
    29972997        return 1;
    29982998    }
    2999    
     2999
    30003000    if (defined($SSL) && ($SSL == 0))
    30013001    {
     
    31063106        $stream .= " ".$ns->GetStream();
    31073107    }
    3108    
     3108
    31093109    $stream .= ">";
    31103110
Note: See TracChangeset for help on using the changeset viewer.