[DGD] Re: httpd?

Risto Karjalainen risto.karjalainen at pp1.inet.fi
Mon Sep 24 19:51:42 CEST 2001


I once ran a little test with the binary port of DGD. I wrote a simple
object that had something like this in its receive_message function:

void receive_message(string str)
{
  string filename, html, tmp;

  sscanf(str, "GET %s %s", filename, tmp);
  html = read_file(filename);
  html = implode(explode(html, "\n"), "\r\n"); /* Newline conversion */
  send_message(html);
  destruct_object(this_object());
}

It's very minimalistic and it hasn't any kind of error tolerance, plus its
features are very limited. Although if I remember correctly, I got it to
work and send simple html documents to my browser. Also I remember I had a
check if the file to send is an image, the newline conversion isn't done.

The code might not work on its own (untested by me), but it mightgive a
little pointer to the right direction.

Regards,
Risto Karjalainen





_________________________________________________________________
List config page:  http://list.imaginary.com/mailman/listinfo/dgd



More information about the DGD mailing list