#include "phttpd.h"

int pm_init(const char **argv)
{
	return 0;
}

void pm_exit(void)
{
}

int pm_request(struct connectioninfo *cip)
{
	char buf[64];
	int fd = cip->fd;
	struct httpinfo *hip = cip->hip;


	if (!(strcasecmp(hip->method, "GET") == 0 ||
	      strcasecmp(hip->method, "HEAD") == 0))
		return -1;

	if (hip->mip)
	{
		http_sendheaders(fd, cip->cn_time, 200, NULL);
		http_sendlastmodified(fd, cip->cn_time);

		fd_puts("Content-Type: text/html\n", fd);
	}
	
	if (strcasecmp(hip->method, "HEAD") == 0)
		return 200;

	if (hip->mip != NULL)
		fd_putc('\n', fd);
   
	html_sysheader(fd, "H2", "Test-Module");

	fd_puts("Hello, World\n", fd);
	html_sysfooter(fd);

	return 200;
}

