/[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 39 by dpavlin, Mon May 10 14:07:44 2004 UTC revision 41 by dpavlin, Mon May 10 20:26:17 2004 UTC
# Line 5  Line 5 
5    
6  use strict;  use strict;
7  use warnings;  use warnings;
8    use MWS::SWISH;
9    #use MWS::Plucene;
10  use HTTP::Daemon;  use HTTP::Daemon;
11  use HTTP::Status;  use HTTP::Status;
12  use IO::String;  use IO::String;
13  use CGI::Lite;  use CGI::Lite;
14  use Template;  use Template;
 use MWS;  
15  use URI::Escape;  use URI::Escape;
16    
17  use Data::Dumper;  use Data::Dumper;
# Line 28  be used. Line 29  be used.
29          exit 1;          exit 1;
30  }  }
31    
32  my $mws = MWS->new($config_file);  my $mws = MWS::SWISH->new(config_file => $config_file);
33    #my $mws = MWS::Plucene->new(config_file => $config_file, debug => $debug);
34    
35  my ($local_addr,$local_port) = ('127.0.0.1',6969);  my ($local_addr,$local_port) = ('127.0.0.1',6969);
36    
37  my $listen = $mws->{config}->val('global', 'listen');  my $listen = $mws->{config}->val('global', 'listen');
38  if ($listen =~ m/:/) {  
39          ($local_addr,$local_port) = split(/:/,$listen);  print STDERR "using listen $listen\n" if ($listen);
40    
41    if ($listen && $listen =~ m/:/) {
42            ($local_addr,$local_port) = split(/:/,$listen,2);
43  } elsif ($listen) {  } elsif ($listen) {
44          $local_addr = $listen;          $local_addr = $listen;
45  }  }
# Line 43  my $d = HTTP::Daemon->new( Line 48  my $d = HTTP::Daemon->new(
48          Reuse => 1,          Reuse => 1,
49          LocalAddr => $local_addr,          LocalAddr => $local_addr,
50          LocalPort => $local_port,          LocalPort => $local_port,
51  ) || die "can't create HTTP::Daemon";  ) || die "can't create HTTP::Daemon on $local_addr:$local_port: $!";
52    
53  my $cgi = new CGI::Lite;  my $cgi = new CGI::Lite;
54  my $tt = Template->new({  my $tt = Template->new({

Legend:
Removed from v.39  
changed lines
  Added in v.41

  ViewVC Help
Powered by ViewVC 1.1.26