chomp serial number to remove LF which ZTE send
authorDobrica Pavlinusic <dpavlin@rot13.org>
Fri, 5 Mar 2010 23:01:51 +0000 (23:01 +0000)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Fri, 5 Mar 2010 23:01:51 +0000 (23:01 +0000)
git-svn-id: https://perl-cwmp.googlecode.com/svn/trunk@247 836a5e1a-633d-0410-964b-294494ad4392

lib/CWMP/Request.pm
lib/CWMP/Store.pm
lib/CWMP/Vendor.pm

index 99770fa..0cea935 100644 (file)
@@ -31,6 +31,7 @@ our $rules =  [
                'ID' => sub {
                        my ($tag_name, $tag_hash, $context, $parent_data) = @_;
                        $state->{ID} = $tag_hash->{_content};
+                       chomp( $state->{ID} );
                },
 
                'DeviceId' => sub {
index 6d9a784..c5b5da9 100644 (file)
@@ -139,6 +139,7 @@ sub state_to_uid {
 
        my $uid = $state->{DeviceID}->{SerialNumber} ||
                confess "no DeviceID.SerialNumber in ",dump( $state );
+       chomp($uid);
 
        return $uid;
 }
index e0cb1d3..fdbdc1e 100644 (file)
@@ -59,6 +59,7 @@ sub state2serial {
        my $state = shift;
 
        my $serial = $state->{DeviceID}->{SerialNumber} || die "no DeviceID.SerialNumber in ",dump($state);
+       chomp($serial);
        my $ip =
                $state->{Parameter}->{'.ExternalIPAddress'} ||
                $state->{Parameter}->{