/[cwmp]/google/trunk/lib/CWMP/Session.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /google/trunk/lib/CWMP/Session.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 110 by dpavlin, Sun Oct 21 01:33:53 2007 UTC revision 111 by dpavlin, Sun Oct 21 22:58:22 2007 UTC
# Line 18  store Line 18  store
18  use HTTP::Daemon;  use HTTP::Daemon;
19  use Data::Dump qw/dump/;  use Data::Dump qw/dump/;
20  use Carp qw/confess cluck croak/;  use Carp qw/confess cluck croak/;
21    use File::Slurp;
22    
23  use CWMP::Request;  use CWMP::Request;
24  use CWMP::Response;  use CWMP::Response;
# Line 66  One request from client/response from se Line 67  One request from client/response from se
67  facilitate brain-dead concept of adding state to stateless protocol like  facilitate brain-dead concept of adding state to stateless protocol like
68  HTTP.  HTTP.
69    
70    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
72    of requests in single session.
73    
74  =cut  =cut
75    
76    my $dump_nr = 0;
77    
78  sub process_request {  sub process_request {
79          my $self = shift;          my $self = shift;
80    
# Line 88  sub process_request { Line 95  sub process_request {
95    
96          my $r = $sock->get_request || confess "can't get_request";          my $r = $sock->get_request || confess "can't get_request";
97    
         warn "<<<< ", $sock->peerhost, " - - [" . localtime() . "] ", $r->method, " ", $r->uri, "\n";  
   
98          my $chunk = $r->content;          my $chunk = $r->content;
99    
100          my $size = length( $chunk );          my $size = length( $chunk );
101    
102          warn "<<<< " . $sock->peerhost . " [" . localtime() . "] request $size bytes\n";          warn "<<<< ", $sock->peerhost, " [" . localtime() . "] ", $r->method, " ", $r->uri, " $size bytes\n";
103    
104            if ( $self->debug > 2 ) {
105                    my $file = $dump_nr++ . '.dump';
106                    write_file( $file, $r->as_string );
107                    warn "### request dump: $file\n";
108            }
109    
110          my $state;          my $state;
111    

Legend:
Removed from v.110  
changed lines
  Added in v.111

  ViewVC Help
Powered by ViewVC 1.1.26