/[pxelator]/lib/PXElator/httpd.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 /lib/PXElator/httpd.pm

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

revision 420 by dpavlin, Thu Sep 10 13:08:36 2009 UTC revision 421 by dpavlin, Fri Sep 11 11:22:40 2009 UTC
# Line 480  sub start { Line 480  sub start {
480                  my $client = $server->accept() || next; # ALARM trickle us                  my $client = $server->accept() || next; # ALARM trickle us
481                  my $request = <$client>;                  my $request = <$client>;
482    
483                  warn "request $request\n" if $debug;                  my $headers;
484    
485                    while ( my $header = <$client> ) {
486                            chomp $header;
487                            last if $header =~ m{^\s*$};
488                            my ( $n, $v ) = split(/:\s*/, $header);
489                            $headers->{ lc $n } = $v;
490                    }
491    
492                    if ( my $host = $headers->{host} ) {
493                            $url = 'http://' . $host;
494                            $url .= ":$port" unless $url =~ m{:\d+$};
495                    }
496    
497                    warn "## $url ## $request", dump( $headers ) if $debug;
498    
499                  if ($request =~ m{^GET (/.*) HTTP/1.[01]}) {                  if ($request =~ m{^GET (/.*) HTTP/1.[01]}) {
500                          my $path = $1;                          my $path = $1;

Legend:
Removed from v.420  
changed lines
  Added in v.421

  ViewVC Help
Powered by ViewVC 1.1.26