Diff for /loncom/lonhttpd between versions 1.4 and 1.5

version 1.4, 2002/10/30 15:32:33 version 1.5, 2002/11/06 22:38:42
Line 183  open (PIDSAVE,">$pidfile"); Line 183  open (PIDSAVE,">$pidfile");
 print PIDSAVE "$$\n";  print PIDSAVE "$$\n";
 close(PIDSAVE);  close(PIDSAVE);
   
 $0 = "dhttpi: binding port ...";  $0 = "lonhttpd: (dhttpi) binding port ...";
 $bindthis = pack($sockaddr, 2, 8080, pack('l', chr(0).chr(0).chr(0).chr(0)));  $bindthis = pack($sockaddr, 2, 8080, pack('l', chr(0).chr(0).chr(0).chr(0)));
 socket(S, 2, 1, 6);  socket(S, 2, 1, 6);
 setsockopt(S, 1, 2, 1);  setsockopt(S, 1, 2, 1);
 bind(S, $bindthis) || die("$0: while binding port 8080:\n\"$!\"\n");  bind(S, $bindthis) || die("$0: while binding port 8080:\n\"$!\"\n");
 listen(S, 128);  listen(S, 128);
 $0 = "dhttpi: connected and waiting ANY:8080";  $0 = "lonhttpd: (dhttpi) connected and waiting ANY:8080";
   
 $statiosuptime = time();  $statiosuptime = time();
   
Line 267  $SIG{'__DIE__'} = \&dead; Line 267  $SIG{'__DIE__'} = \&dead;
 $SIG{'ALRM'} = $SIG{'TERM'} = $SIG{'INT'} = \&bye;  $SIG{'ALRM'} = $SIG{'TERM'} = $SIG{'INT'} = \&bye;
   
 sub master {  sub master {
  $0 = "dhttpi: handling request";   $0 = "lonhttpd: (dhttpi) handling request";
 # $sock = getpeername(STDIN);  # $sock = getpeername(STDIN);
 $rfcdate = scalar gmtime;  $rfcdate = scalar gmtime;
 ($dow, $mon, $dt, $tm, $yr) = ($rfcdate =~  ($dow, $mon, $dt, $tm, $yr) = ($rfcdate =~
Line 426  EOF Line 426  EOF
 <html>  <html>
 <head>  <head>
 <title>  <title>
 HTTPi Status  LonHTTPD (HTTPi) Status
 </title>  </title>
 </head>  </head>
 <body bgcolor = "#ffffff" text = "#000000" vlink = "#0000ff" link = "#0000ff">  <body bgcolor = "#ffffff" text = "#000000" vlink = "#0000ff" link = "#0000ff">
 <h1>HTTPi Server Status (<code>$VERSION</code>)</h1>  <h1>LonHTTPD (HTTPi) Server Status (<code>$VERSION</code>)</h1>
 <h3>lonhttpd on port 8080</h3>  <h3>lonhttpd on port 8080</h3>
 <b>Started at:</b> $suptime<br>  <b>Started at:</b> $suptime<br>
 <b>Uptime:</b> $d days, $h:$m:$s<br>  <b>Uptime:</b> $d days, $h:$m:$s<br>
Line 571  for (;;) { Line 571  for (;;) {
  $statiosltr = scalar localtime;   $statiosltr = scalar localtime;
  $statiosreq++;   $statiosreq++;
  if ($pid = fork()) {   if ($pid = fork()) {
  $0 = "dhttpi: waiting for child process";   $0 = "lonhttpd: (dhttpi) waiting for child process";
  waitpid($pid, 0);   waitpid($pid, 0);
  $0 = "dhttpi: on ANY:8080, last request " .   $0 = "lonhttpd: (dhttpi) on ANY:8080, last request " .
  scalar localtime;   scalar localtime;
  } else {   } else {
  $0 = "dhttpi: child switching to socket";   $0 = "lonhttpd: (dhttpi) child switching to socket";
  open(STDIN, "<&NS");   open(STDIN, "<&NS");
  open(STDOUT, ">&NS");   open(STDOUT, ">&NS");
  &master;   &master;

Removed from v.1.4  
changed lines
  Added in v.1.5


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>