68 |
HTTP. |
HTTP. |
69 |
|
|
70 |
If used with debugging level of 3 or more, it will also create dumps of |
If used with debugging level of 3 or more, it will also create dumps of |
71 |
requests named C<< nr.dump >> where C<nr> is number from 0 to total number |
requests named C<< dump/nr.request >> where C<nr> is number from 0 to total number |
72 |
of requests in single session. |
of requests in single session. |
73 |
|
|
74 |
=cut |
=cut |
102 |
warn "<<<< ", $sock->peerhost, " [" . localtime() . "] ", $r->method, " ", $r->uri, " $size bytes\n"; |
warn "<<<< ", $sock->peerhost, " [" . localtime() . "] ", $r->method, " ", $r->uri, " $size bytes\n"; |
103 |
|
|
104 |
if ( $self->debug > 2 ) { |
if ( $self->debug > 2 ) { |
105 |
my $file = $dump_nr++ . '.dump'; |
my $file = sprintf("dump/%04d.request", $dump_nr); |
106 |
write_file( $file, $r->as_string ); |
write_file( $file, $r->as_string ); |
107 |
warn "### request dump: $file\n"; |
warn "### request dump: $file\n"; |
108 |
} |
} |
172 |
|
|
173 |
$xml = $self->dispatch('Inform', $response_arguments ); |
$xml = $self->dispatch('Inform', $response_arguments ); |
174 |
|
|
175 |
|
If debugging level of 3 or more, it will create dumps of responses named C<< dump/nr.response >> |
176 |
|
|
177 |
=cut |
=cut |
178 |
|
|
179 |
sub dispatch { |
sub dispatch { |
187 |
warn ">>> dispatching to $dispatch\n"; |
warn ">>> dispatching to $dispatch\n"; |
188 |
my $xml = $response->$dispatch( $self->state, @_ ); |
my $xml = $response->$dispatch( $self->state, @_ ); |
189 |
warn "## response payload: ",length($xml)," bytes\n$xml\n" if $self->debug; |
warn "## response payload: ",length($xml)," bytes\n$xml\n" if $self->debug; |
190 |
|
if ( $self->debug > 2 ) { |
191 |
|
my $file = sprintf("dump/%04d.response", $dump_nr++); |
192 |
|
write_file( $file, $xml ); |
193 |
|
warn "### response dump: $file\n"; |
194 |
|
} |
195 |
return $xml; |
return $xml; |
196 |
} else { |
} else { |
197 |
confess "can't dispatch to $dispatch"; |
confess "can't dispatch to $dispatch"; |