107 |
|
|
108 |
warn "<<<< ", $sock->peerhost, " [" . localtime() . "] ", $r->method, " ", $r->uri, " $size bytes\n"; |
warn "<<<< ", $sock->peerhost, " [" . localtime() . "] ", $r->method, " ", $r->uri, " $size bytes\n"; |
109 |
|
|
110 |
|
$dump_nr++; |
111 |
|
my $file = sprintf("dump/%04d-%s.request", $dump_nr, $sock->peerhost); |
112 |
|
|
113 |
if ( $self->debug > 2 ) { |
if ( $self->debug > 2 ) { |
|
my $file = sprintf("dump/%04d-%s.request", $dump_nr++, $sock->peerhost); |
|
114 |
write_file( $file, $r->as_string ); |
write_file( $file, $r->as_string ); |
115 |
warn "### request dumped to file: $file\n"; |
warn "### request dumped to file: $file\n"; |
116 |
} |
} |
125 |
|
|
126 |
$state = CWMP::Request->parse( $xml ); |
$state = CWMP::Request->parse( $xml ); |
127 |
|
|
128 |
|
if ( defined( $state->{_dispatch} ) && $self->debug > 2 ) { |
129 |
|
my $type = sprintf("dump/%04d-%s-%s", $dump_nr, $sock->peerhost, $state->{_dispatch}); |
130 |
|
symlink $file, $type || warn "can't symlink $file -> $type: $!"; |
131 |
|
} |
132 |
|
|
133 |
warn "## acquired state = ", dump( $state ), "\n"; |
warn "## acquired state = ", dump( $state ), "\n"; |
134 |
|
|
135 |
$self->state( $state ); |
$self->state( $state ); |