Branch: Tag:

1999-03-19

1999-03-19 19:59:35 by David Hedbor <david@hedbor.org>

Now compiles and works with 0.7 (httpd doesn't exactly work perfectly though).

Rev: bin/httpd.pike:1.3
Rev: bin/rsif:1.2

1:   #!/usr/local/bin/pike    - /* $Id: httpd.pike,v 1.2 1997/05/31 22:03:38 grubba Exp $ */ + /* $Id: httpd.pike,v 1.3 1999/03/19 19:59:33 neotron Exp $ */      /* A very small httpd capable of fetching files only.    * Written by Fredrik Hübinette as a demonstration of Pike
8:      #include <simulate.h>    - inherit "/precompiled/port"; + inherit Stdio.Port;      /* number of bytes to read for each write */   #define BLOCK 16060
24:      program output_class=class   { -  inherit "/precompiled/file" : socket; -  inherit "/precompiled/file" : file; +  inherit Stdio.File : socket; +  inherit Stdio.File : file;       int offset=0;   
36:       file::seek(offset);    data=file::read(BLOCK); -  if(strlen(data)) +  if(data && strlen(data))    {    written=socket::write(data);    if(written >= 0)