pike.git / bin / httpd.pike

version» Context lines:

pike.git/bin/httpd.pike:1:   #!/usr/local/bin/pike    - /* $Id: httpd.pike,v 1.4 2002/12/01 01:38:28 nilsson Exp $ */ + /* $Id: httpd.pike,v 1.5 2003/01/20 17:48:45 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:29:       int offset=0;       void write_callback()    {    int written;    string data;       file::seek(offset);    data=file::read(BLOCK); -  if(data && strlen(data)) +  if(data && sizeof(data))    {    written=socket::write(data);    if(written >= 0)    {    offset+=written;    return;    }    perror("Error: "+socket::errno()+".\n");    }    destruct(this_object());