Changeset 80524e9e81a412ca74c34a84be3d28b8a923fb3b in xas


Ignore:
Timestamp:
11/14/14 15:17:50 (5 years ago)
Author:
Kevin L. Esteb <kevin@…>
Branches:
master
Children:
25ca773a7bed52abaa65a1759ae36c4673684f38
Parents:
356a9c26c4b3ecd30059f983907d4b00a270c27e
git-author:
Kevin L. Esteb <kevin@…> (11/14/14 15:17:50)
git-committer:
Kevin L. Esteb <kevin@…> (11/14/14 15:17:50)
Message:

Debugging is fun, fixed a lot of errors

Location:
trunk/lib/XAS/Lib
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/XAS/Lib/Mixins/Bufops.pm

    r93108680fafeff0136339108723498ef637340df r80524e9e81a412ca74c34a84be3d28b8a923fb3b  
    3838    my ($buffer, $eol) = $self->validate_params(\@_, [ 
    3939        { type => SCALARREF }, 
    40         { type => SCALAR }, 
     40        { type => SCALAR | SCALARREF }, 
    4141    ]); 
    4242 
  • trunk/lib/XAS/Lib/Mixins/Keepalive.pm

    r03b0c311fbd4242bc4d527b8d4efd888ab885865 r80524e9e81a412ca74c34a84be3d28b8a923fb3b  
    1414  version   => $VERSION, 
    1515  base      => 'XAS::Base', 
    16   accessors => 'tpc_keepalive tcp_keepcnt tcp_keepintvl', 
    17   mixins    => 'init_keepalive enable_keepalive tpc_keepalive tcp_keepcnt tcp_keepintvl', 
     16  accessors => 'tcp_keepidle tcp_keepcnt tcp_keepintvl', 
     17  mixins    => 'init_keepalive enable_keepalive tcp_keepidle tcp_keepcnt tcp_keepintvl', 
    1818; 
    1919 
     
    5555     
    5656    $self->{tcp_keepcnt}   = $p->{tcp_keepcnt}; 
    57     $self->{tcp_keepidle}  = $p->{tcp_keepalive}; 
     57    $self->{tcp_keepidle}  = $p->{tcp_keepidle}; 
    5858    $self->{tcp_keepintvl} = $p->{tcp_keepintvl}; 
    5959                                             
  • trunk/lib/XAS/Lib/Stomp/Frame.pm

    r02e63ea8e5fd59bb0d24401148b48650779fcc52 r80524e9e81a412ca74c34a84be3d28b8a923fb3b  
    197197 
    198198use XAS::Class 
     199  debug     => 0, 
    199200  version   => $VERSION, 
    200201  base      => 'XAS::Base', 
  • trunk/lib/XAS/Lib/Stomp/POE/Client.pm

    r356a9c26c4b3ecd30059f983907d4b00a270c27e r80524e9e81a412ca74c34a84be3d28b8a923fb3b  
    214214    my $self = $class->SUPER::init(@_); 
    215215 
    216     $self->{stomp} = XAS::Lib::Stomp::Utils->new(); 
    217  
    218     unless (defined($self->{filter})) { 
    219  
    220         $self->{filter} = XAS::Lib::Stomp::POE::Filter->new( 
    221             -target => $self->target 
    222         ); 
    223  
    224     } 
     216    $self->{stomp}  = XAS::Lib::Stomp::Utils->new(); 
     217    $self->{filter} = XAS::Lib::Stomp::POE::Filter->new( 
     218        -target => $self->target 
     219    ); 
    225220 
    226221    return $self; 
  • trunk/lib/XAS/Lib/Stomp/POE/Filter.pm

    r38128197c45d042e39470f4e93dde558df66a156 r80524e9e81a412ca74c34a84be3d28b8a923fb3b  
    66 
    77use XAS::Class 
    8   debug   => 0, 
    9   version => $VERSION, 
    10   base    => 'XAS::Base', 
    11   accessors => 'filter', 
     8  debug     => 0, 
     9  version   => $VERSION, 
     10  base      => 'XAS::Base', 
     11  accessors => 'filter eol', 
     12  constants => 'CRLF', 
     13  constant => { 
     14    LF  => "\n", 
     15  }, 
    1216  vars => { 
    1317    PARAMS => { 
     
    1620  } 
    1721; 
     22 
     23use Data::Hexdumper; 
    1824 
    1925# --------------------------------------------------------------------- 
     
    6571    foreach my $frame (@$frames) { 
    6672 
    67         my $buffer = $frame->as_string; 
     73        my $buffer = $frame->as_string . $self->eol(); 
    6874 
     75        $self->log->debug(hexdump($buffer)); 
    6976        push(@ret, $buffer); 
    7077 
     
    8491    my $self = $class->SUPER::init(@_); 
    8592 
     93    $self->{eol} = ($self->target > 1.1) ? CRLF : LF; 
    8694    $self->{filter} = XAS::Lib::Stomp::Parser->new( 
    8795        -target => $self->target, 
    88         -xdebug => $self->xdebug, 
    8996    ); 
    9097 
  • trunk/lib/XAS/Lib/Stomp/Parser.pm

    ra8ad2afce0108d9191ae10a2dc9a2be02f34e216 r80524e9e81a412ca74c34a84be3d28b8a923fb3b  
    99  version   => $VERSION, 
    1010  base      => 'XAS::Base', 
     11  mixin     => 'XAS::Lib::Mixins::Bufops', 
    1112  utils     => 'trim', 
    1213  accessors => 'target', 
     
    2627 
    2728#use Data::Dumper; 
    28 #use Data::Hexdumper; 
     29use Data::Hexdumper; 
    2930 
    3031# ---------------------------------------------------------------------- 
     
    4445    $self->{buffer} .= $buffer; 
    4546 
    46     $self->log->debug('buffer'); 
    47 #    $self->log->debug(hexdump($self->{buffer})); 
     47    $self->log->debug('stomp parse'); 
     48    $self->log->debug(hexdump($self->{buffer})); 
    4849 
    4950    # A valid frame is usually this: 
     
    8081            # check for a valid buffer, must have a EOL someplace. 
    8182 
    82             if ($line = $self->_read_line($EOL)) { 
     83            if ($line = $self->buf_get_line(\$self->{buffer}, $EOL)) { 
    8384 
    8485                $self->log->debug('command'); 
    85 #                $self->log->debug(hexdump($line)); 
     86                $self->log->debug(hexdump($line)); 
    8687 
    8788                $line = trim($line); 
     
    118119            if (($clength != -1) && ($clength <= $length)) { 
    119120 
    120                 $line = $self->_slurp($clength); 
    121 #                $self->log->debug(hexdump($line)); 
     121                $line = $self->buf_slurp(\$self->{buffer}, $clength); 
     122                $self->log->debug(hexdump($line)); 
    122123 
    123124                while ($line =~ s/^$HEADER//) { 
     
    170171                if ($clength <= $length) { 
    171172 
    172                     $self->{body} = $self->_slurp($clength); 
     173                    $self->{body} = $self->buf_slurp(\$self->{buffer}, $clength); 
    173174                    $self->{state} = 'frame'; 
    174175 
     
    183184                if (($clength != -1) && ($clength <= $length)) { 
    184185 
    185                     $self->{body} = $self->_read_line($EOF); 
     186                    $self->{body} = $self->buf_get_line(\$self->{buffer}, $EOF); 
    186187                    chop $self->{body}; 
    187188                    $self->{state} = 'frame'; 
     
    246247} 
    247248 
    248 sub _read_line { 
    249     my $self = shift; 
    250     my $eol  = shift; 
    251  
    252     my $pos; 
    253     my $buffer; 
    254  
    255     if ($self->{buffer} =~ m/$eol/g) { 
    256  
    257         $pos = pos($self->{buffer}); 
    258         $buffer = $self->_slurp($pos); 
    259  
    260     } 
    261  
    262     return $buffer; 
    263  
    264 } 
    265  
    266 sub _slurp { 
    267     my $self = shift; 
    268     my $pos  = shift; 
    269  
    270     my $buffer; 
    271  
    272     if ($buffer = substr($self->{buffer}, 0, $pos)) { 
    273  
    274         substr($self->{buffer}, 0, $pos) = ""; 
    275  
    276     } 
    277  
    278     return $buffer; 
    279  
    280 } 
    281  
    2822491; 
    283250 
Note: See TracChangeset for help on using the changeset viewer.