/[mws]/trunk/httpd.pl
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 /trunk/httpd.pl

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

revision 24 by dpavlin, Sat May 8 14:27:54 2004 UTC revision 25 by dpavlin, Sat May 8 16:06:58 2004 UTC
# Line 28  my $tt = Template->new({ Line 28  my $tt = Template->new({
28          EVAL_PERL => 1,          EVAL_PERL => 1,
29  });  });
30    
31    my $static_html = $mws->{config}->val('global', 'static_html');
32    
33  print "Web server ready at: ", $d->url, "\n";  print "Web server ready at: ", $d->url, "\n";
34    
35    
# Line 73  while ( my $c = $d->accept ) { Line 75  while ( my $c = $d->accept ) {
75                  # XXX LOG                  # XXX LOG
76                  print $r->method," ",$url,"\n",Dumper($param),"\n" if ($debug);                  print $r->method," ",$url,"\n",Dumper($param),"\n" if ($debug);
77    
78                    # is this static page?
79                    if ($static_html && -f "$static_html/$url") {
80                            print "static file: $static_html/$url\n" if ($debug);
81                            $c->send_file_response("$static_html/$url");
82                            $c->close;
83                            next;
84                    }
85    
86                  # template file name (use ?format=html as default)                  # template file name (use ?format=html as default)
87                  my $tpl_file = 'master.';                  my $tpl_file = 'master.';
88                  $tpl_file .= $param->{'format'} || 'html';                  $tpl_file .= $param->{'format'} || 'html';
# Line 142  while ( my $c = $d->accept ) { Line 152  while ( my $c = $d->accept ) {
152                          my @res = $mws->fetch_all_results();                          my @res = $mws->fetch_all_results();
153    
154                          $tpl_var->{results} = \@res if (@res);                          $tpl_var->{results} = \@res if (@res);
155                          $tpl_var->{total_hits} = $mws->{total_hits};                          $tpl_var->{total_hits} = $mws->{total_hits} || 0;
156    
157                  }                  }
158    

Legend:
Removed from v.24  
changed lines
  Added in v.25

  ViewVC Help
Powered by ViewVC 1.1.26