Fixed resource leakage during connection accept(2)
[middleman.git] / include / pages.h
1 #ifndef PAGES_H
2 #define PAGES_H
3 #include "proto.h"
4
5 #define PAGE_HEAD "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">\n"
6 #define PAGE_TOP PAGE_HEAD "<body text=\"" INTERFACE_TEXT "\" bgcolor=\"" INTERFACE_BG "\" link=\"" INTERFACE_LINK "\" vlink=\"" INTERFACE_VLINK "\"><table cellspacing=\"0\" cellpadding=\"0\" border=\"0\" width=\"100%%\">\n<tr><td align=\"center\">\n<table cellspacing=\"0\" cellpadding=\"0\" border=\"0\" width=\"60%%\" bgcolor=\"" INTERFACE_TABLEBG "\">\n<tr><td align=\"center\"><font size=\"6\">"
7 #define PAGE_BOTTOM "</font></td></tr><tr><td><br></td></tr></table></body></html>"
8
9 struct {
10         char *name;
11         char *content;
12         char *mime;
13         int len;
14 } PAGES[] = {
15         {
16         "unknown", "<html><head><title>Error</title></head>" PAGE_TOP "Error" PAGE_BOTTOM, "text/html", -1}, {
17         "badrequest", "<html><head><title>Bad Request</title></head>" PAGE_TOP "Bad Request" PAGE_BOTTOM, "text/html", -1}, {
18         "badresponse", "<html><head><title>Bad Response</title></head>" PAGE_TOP "Bad Response" PAGE_BOTTOM, "text/html", -1}, {
19         "nodns", "<html><head><title>DNS Lookup failed</title></head>" PAGE_TOP "DNS Lookup for $HTTP_HOST failed" PAGE_BOTTOM, "text/html", -1}, {
20         "nofile", "<html><head><title>File not found</title></head>" PAGE_TOP "$HTTP_FILE not found" PAGE_BOTTOM, "text/html", -1}, {
21         "noconnect", "<html><head><title>Connection failed</title></head>" PAGE_TOP "Connection to $HTTP_HOST:$HTTP_PORT failed" PAGE_BOTTOM, "text/html", -1}, {
22         "blocked", "<html><head><title>Page Blocked</title></head>" PAGE_TOP "$HTTP_HOST$HTTP_FILE is blocked" PAGE_BOTTOM, "text/html", -1}, {
23         "badprotocol", "<html><head><title>Protocol not implemented</title></head>" PAGE_TOP "Protocol not implemented" PAGE_BOTTOM, "text/html", -1}, {
24         "noaccess" , "<html><head><title>Access denied</title></head>" PAGE_TOP "Access denied" PAGE_BOTTOM, "text/html", -1}, {
25         "badauth", "<html><head><title>Authorization failed</title></head>" PAGE_TOP "Authorization failed" PAGE_BOTTOM, "text/html", -1}, {
26                 /* borrowed from privoxy */
27         "tinygif", "\x47\x49\x46\x38\x39\x61\x01\x00\x01\x00\x80\x00\x00\xff\xff\xff\x00\x00\x00\x21\xf9\x04\x01\x00\x00\x00\x00\x2c\x00\x00\x00\x00\x01\x00\x01\x00\x00\x02\x02\x44\x01\x00\x3b", "image/gif", 43}, {
28         "checkeredgif", "\107\111\106\070\071\141\004\000\004\000\200\000\000\310\310\310\377\377\377\041\376\016\111\040\167\141\163\040\141\040\142\141\156\156\145\162\000\041\371\004\001\012\000\001\000\054\000\000\000\000\004\000\004\000\000\002\005\104\174\147\270\005\000\073", "image/gif", 64}, {
29         "tinyswf", "\x46\x57\x53\x04\x86\x01\x00\x00\x30\x0a\x00\xa0\x00\x0c\x01\x00\x43\x02\x00\x00\x00\x7f\x05\x3b\x01\x00\x00\x01\x00\xff\xd9\xff\xd8\xff\xd8\xff\xe0\x00\x10\x4a\x46\x49\x46\x00\x01\x01\x01\x00\x48\x00\x48\x00\x00\xff\xfe\x00\x17\x43\x72\x65\x61\x74\x65\x64\x20\x77\x69\x74\x68\x20\x54\x68\x65\x20\x47\x49\x4d\x50\xff\xdb\x00\x43\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xdb\x00\x43\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xc0\x00\x11\x08\x00\x01\x00\x01\x03\x01\x22\x00\x02\x11\x01\x03\x11\x01\xff\xc4\x00\x15\x00\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x03\xff\xc4\x00\x14\x10\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\xc4\x00\x14\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\xc4\x00\x14\x11\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\xda\x00\x0c\x03\x01\x00\x02\x11\x03\x11\x00\x3f\x00\xa0\x00\xff\xd9\xbf\x00\x1e\x00\x00\x00\x02\x00\x30\x0a\x00\xa0\x01\x41\x01\x00\xd9\x40\x00\x05\x00\x00\x00\x00\x10\x14\xca\x29\xd0\xb3\x46\xcd\x05\x34\x54\x00\x86\x06\x06\x01\x00\x02\x00\x00\x40\x00\x00\x00\x0a", "application/x-shockwave", 327}, {
30         "empty", "", "text/plain", 0}, {
31         NULL, NULL, NULL, 0}
32 };
33
34 #endif                          /* PAGES_H */