10 |
/ ); |
/ ); |
11 |
|
|
12 |
use Data::Dump qw/dump/; |
use Data::Dump qw/dump/; |
13 |
|
use CWMP::Request; |
14 |
|
use CWMP::Response; |
15 |
|
|
16 |
=head1 NAME |
=head1 NAME |
17 |
|
|
36 |
if ( $transfer_encoding && $transfer_encoding =~ qr/^chunked/i ) { |
if ( $transfer_encoding && $transfer_encoding =~ qr/^chunked/i ) { |
37 |
|
|
38 |
my $len = 0; |
my $len = 0; |
39 |
|
my $hex; |
40 |
do { |
do { |
41 |
$len = <STDIN>; |
$hex = <STDIN>; # get chunk length |
42 |
$len =~ s/[\n\r]*$//s; |
$hex =~ s/[\n\r]*$//s; |
43 |
$len = hex( $len ); |
$len = hex( $hex ); |
44 |
|
|
45 |
#warn "getting chunk of $len bytes\n"; |
warn "getting chunk of 0x$hex $len bytes\n" if $self->debug; |
46 |
|
|
47 |
while( $len > 0 ) { |
while( $len > 0 ) { |
48 |
my $line = <STDIN>; |
my $line = <STDIN>; |
50 |
$len -= length( $line ); |
$len -= length( $line ); |
51 |
} |
} |
52 |
|
|
53 |
} while ( $len > 0 ); |
} while ( hex( $hex ) != 0 ); |
54 |
} |
} |
55 |
|
|
56 |
warn "got ", length($chunk), " bytes\n" if $self->debug; |
warn "handler got ", length($chunk), " bytes\n" if $self->debug; |
57 |
|
|
58 |
my $cgi = new CGI( $chunk ); |
my $cgi = new CGI( $chunk ); |
59 |
|
|
89 |
|
|
90 |
} |
} |
91 |
|
|
92 |
my $response = CWMP::Server->new({ debug => $self->debug }); |
my $response = CWMP::Response->new({ debug => $self->debug }); |
93 |
|
|
94 |
print "Content-Type: text/xml\r\n\r\n"; |
print "Content-Type: text/xml\r\n\r\n"; |
95 |
|
|