if ( $self->create_dump ) {
write_file( $file, $r->as_string );
- warn "### request dumped to file: $file\n";
+ warn "### request dumped to file: $file\n" if $self->debug;
}
my $state;
symlink $file, $type || warn "can't symlink $file -> $type: $!";
}
- warn "## acquired state = ", dump( $state ), "\n";
+ warn "## acquired state = ", dump( $state ), "\n" if $self->debug;
if ( ! defined( $state->{DeviceID} ) ) {
warn "## state with DeviceID, using old one...\n";
}
$self->state( $state );
- $self->store->update_state( ID => $state->{ID}, $state );
+ $self->store->update_state( $state );
} else {
$sock->send( "Set-Cookie: ID=" . $state->{ID} . "; path=/\r\n" ) if ( $state->{ID} );
- my $uid = $self->store->ID_to_uid( $state->{ID}, $state );
+ my $uid = $self->store->state_to_uid( $state );
my $queue = CWMP::Queue->new({
id => $uid,
sub dispatch {
my $self = shift;
-warn "##!!! dispatch(",dump( @_ ),")\n";
-
my $dispatch = shift || die "no dispatch?";
my $args = shift;
if ( $self->create_dump ) {
my $file = sprintf("dump/%04d-%s.response", $dump_nr++, $self->sock->peerhost);
write_file( $file, $xml );
- warn "### response dump: $file\n";
+ warn "### response dump: $file\n" if $self->debug;
}
return $xml;
} else {