- printf("Date: %s", ctime(&tempo));
- printf("Server: WWWd test server\n");
- printf("Connection: close\n");
- printf("Content-Type: text/html; charset=iso-8859-1\n");
- printf("\n");
+ return;
+}
+
+void print_err404(FILE *file, char *filename)
+{
+ fprintf(file, "<HTML><HEAD><TITLE>404 Not Found</TITLE></HEAD>\n");
+ fprintf(file, "<BODY><H1>Not Found</H1>\nThe requested ");
+ fprintf(file, "URL %s was not found on this server.<P><HR>", filename);
+ fprintf(file, "<ADDRESS>WWWd by Simone Piccardi</ADDRESS></BODY></HTML>");
+ return;
+}
+
+void print_err400(FILE *file, char *string)
+{
+ fprintf(file, "<HTML><HEAD><TITLE>404 Bad Request</TITLE></HEAD>\n");
+ fprintf(file, "<BODY><H1>Bad Request</H1>\n ");
+ fprintf(file, "Your browser sent a request that this server could not ");
+ fprintf(file, "understand.<P>The request line<P> %s <P>", string);
+ fprintf(file, "is invalid following the protocol<p><HR>");
+ fprintf(file, "<ADDRESS>WWWd by Simone Piccardi </ADDRESS></BODY></HTML>");
+ return;
+}
+
+
+void print_err500(FILE *file, char *string)
+{
+ fprintf(file, "<HTML><HEAD><TITLE>500 Internal Server Error</TITLE>\n");
+ fprintf(file, "</HEAD><BODY><H1>Internal Server Error</H1>\n ");
+ fprintf(file, "We got an error processing your request.<P>");
+ fprintf(file, "Error is: %s <P><HR>\n", string);
+ fprintf(file, "<ADDRESS>WWWd by Simone Piccardi </ADDRESS></BODY></HTML>");