pike.git / bin / httpd.pike

version» Context lines:

pike.git/bin/httpd.pike:1:   #!/usr/local/bin/pike    - /* $Id: httpd.pike,v 1.3 1999/03/19 19:59:33 neotron Exp $ */ + /* $Id: httpd.pike,v 1.4 2002/12/01 01:38:28 nilsson Exp $ */      /* A very small httpd capable of fetching files only.    * Written by Fredrik Hübinette as a demonstration of Pike    */      #include <simulate.h>      inherit Stdio.Port;      /* number of bytes to read for each write */
pike.git/bin/httpd.pike:91:    socket::assign(f);    socket::set_nonblocking(read_callback,0,selfdestruct);    }   };      void accept_callback()   {    object tmp_output;    tmp_output=accept();    if(!tmp_output) return; -  clone(output_class, tmp_output); +  output_class(tmp_output);    destruct(tmp_output);   }      int main(int argc, string *argv)   {    perror("Starting minimal httpd\n");       if(!bind(PORT, accept_callback))    {    perror("Failed to open socket (already bound?)\n");    return 17;    }       return - 17; /* Keep going */   }