File Coverage

blib/lib/Protocol/XMPP/Element/StartTLS.pm
Criterion Covered Total %
statement 9 15 60.0
branch n/a
condition n/a
subroutine 3 4 75.0
pod 1 1 100.0
total 13 20 65.0


line stmt bran cond sub pod time code
1             package Protocol::XMPP::Element::StartTLS;
2              
3 1     1   253882 use strict;
  1         2  
  1         33  
4 1     1   3 use warnings;
  1         1  
  1         59  
5 1     1   5 use parent qw(Protocol::XMPP::ElementBase);
  1         1  
  1         6  
6              
7             our $VERSION = '0.007'; ## VERSION
8              
9             =head1 NAME
10              
11             =head1 SYNOPSIS
12              
13             =head1 DESCRIPTION
14              
15             =head1 METHODS
16              
17             =cut
18              
19             sub end_element {
20 0     0 1   my $self = shift;
21 0           $self->debug('TLS available');
22 0           $self->stream->{features}->{tls} = 1;
23 0           $self->stream->{tls_pending} = 1;
24              
25             # screw this, let's go straight into TLS mode
26 0           $self->write_xml(['starttls', _ns => 'xmpp-tls']);
27 0           $self;
28             }
29              
30             1;
31              
32             __END__